DOC PREVIEW
UCSD CSE 123B - HTTP

This preview shows page 1-2-15-16-17-32-33 out of 33 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 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 33 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 33 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 33 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 33 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 33 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 33 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 123bCSE 123bCommunications SoftwareCommunications SoftwareSpring 2004Spring 2004Lecture 11: HTTPLecture 11: HTTPStefan SavageStefan SavageSome slides courtesy Srini SeshanMay 9, 2004 CSE 123b – Lecture 11 -- DNS 2Quick admin issuesQuick admin issuesz Project◆ Walter will be having extended office hours today (12:30-2:30) in EBU1 6307◆ Other times?z Midterm◆ Covers up to and including Mobile IP◆ Closed book/notes (you can have one 8.5x11 sheet)◆ No formal review session◆ I will be available for office hours on Monday 1-3pmMay 9, 2004 CSE 123b – Lecture 11 -- DNS 3HTTP BasicsHTTP Basicsz HTTP layered over TCPz Interaction◆ Client sends request to server, followed by response from server to client◆ Requests/responses are encoded in textz How to mark end of message?◆ Size of message Æ Content-Length» Must know size of transfer in advance◆ Delimiter Æ MIME style Content-Type» Server must “byte-stuff”◆ Close connection» Only server can do thisMay 9, 2004 CSE 123b – Lecture 11 -- DNS 4HTTP MessagesHTTP Messagesz Four parts◆ START LINE <CRLF>» Request or response◆ MESSAGE HEADER <CRLF> <CRLF>» 0 or more of these; meta data◆ MESSAGE BODY <CRLF>» Actual contentMay 9, 2004 CSE 123b – Lecture 11 -- DNS 5HTTP RequestHTTP Requestz Request line◆ Method» GET – return URL» HEAD – return headers only of GET response» POST – send data to the server (forms, etc.)◆ URL» E.g. http://www.cs.ucsd.edu/index.html» index.html by default◆ HTTP versionz ExampleGET http:www.cs.ucsd.edu/index.html HTTP/1.1May 9, 2004 CSE 123b – Lecture 11 -- DNS 6HTTP RequestHTTP Requestz Request headers◆ Authorization – authentication info◆ Acceptable document types/encodings◆ From – user email◆ If-Modified-Since◆ Host◆ Referrer – what caused this page to be requested◆ User-Agent – client softwareMay 9, 2004 CSE 123b – Lecture 11 -- DNS 7HTTP Request ExampleHTTP Request ExampleGET / HTTP/1.1Accept: */*Accept-Language: en-usAccept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)Host: www.cs.ucsd.eduConnection: Keep-AliveMay 9, 2004 CSE 123b – Lecture 11 -- DNS 8HTTP ResponseHTTP Responsez Status-line (response)◆ HTTP version◆ 3 digit response code» 1XX – informational» 2XX – success» 3XX – redirection» 4XX – client error» 5XX – server error◆ Reason phraseMay 9, 2004 CSE 123b – Lecture 11 -- DNS 9HTTP ResponseHTTP Responsez Headers◆ Location – for redirection◆ Server – server software◆ WWW-Authenticate – request for authentication◆ Allow – list of methods supported (get, head, etc)◆ Content-Encoding – E.g x-gzip◆ Content-Length◆ Content-Type◆ Expires◆ Last-ModifiedMay 9, 2004 CSE 123b – Lecture 11 -- DNS 10HTTP Response ExampleHTTP Response ExampleHTTP/1.1 200 OKDate: Tue, 27 Mar 2001 03:49:38 GMTServer: Apache/1.3.14 (Unix) (Red-Hat/Linux) mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.1pl2 mod_perl/1.24Last-Modified: Mon, 29 Jan 2001 17:54:18 GMTETag: "7a11f-10ed-3a75ae4a"Accept-Ranges: bytesContent-Length: 4333Keep-Alive: timeout=15, max=100Connection: Keep-AliveContent-Type: text/html…..May 9, 2004 CSE 123b – Lecture 11 -- DNS 11How HTTP is usedHow HTTP is usedz Browser requests main pagez Browser parses main page for inline images and content (e.g. <imgsrc=http://k.com/pics/bullet>)◆ Typically 4-5 of these◆ Issues additional requests to server (or other server) for additional data itemsz Browser computes location of objects on page (layout)z Browser draws each object on the screen (rendering)z If user clicks on a link (href) then restart processMay 9, 2004 CSE 123b – Lecture 11 -- DNS 12The Way Web Surfing Works... The Way Web Surfing Works... Check cacheDNS lookupRequest objectLayoutRenderGETA? www.cnn.comA= 207.25.71.20DATABrowserDNSServerHTTPServerTCP connectionSYNSYN/ACKMay 9, 2004 CSE 123b – Lecture 11 -- DNS 13Single Transfer ExampleSingle Transfer ExampleClientServerSYNSYNSYNSYNACKACKACKACKACKDATDATDATDATFINACK0 RTT1 RTT2 RTT3 RTT4 RTTServer reads from diskFINServer reads from diskClient opens TCP connectionClient sends HTTP request for HTMLClient parses HTMLClient opens TCP connectionClient sends HTTP request for imageImage begins to arriveMay 9, 2004 CSE 123b – Lecture 11 -- DNS 14ProblemsProblemsz Short transfers are hard on TCP◆ Stuck in slow start◆ Loss recovery is poor when windows are small. Why?z Lots of extra connections◆ Increases server state/processingz Server also forced to keep TIME_WAIT connection state◆ Why must server keep these?◆ Tends to be an order of magnitude greater than # of active connectionsMay 9, 2004 CSE 123b – Lecture 11 -- DNS 15Netscape SolutionNetscape Solutionz Use multiple concurrent connections to improve response time◆ Different parts of Web page arrive independently◆ Can grab more of the network bandwidth than other usersz Doesn’t necessarily improve response time◆ TCP loss recovery can be timeout dominated because windows are smallMay 9, 2004 CSE 123b – Lecture 11 -- DNS 16HTTP 0.9/1.0HTTP 0.9/1.0z One request/response per TCP connection◆ Simple to implementz Disadvantages◆ Multiple connection setups Æ three-way handshake each time» Several extra round trips added to transfer◆ Multiple slow startsMay 9, 2004 CSE 123b – Lecture 11 -- DNS 17Persistent Connection Persistent Connection SolutionSolutionz Multiplex multiple transfers onto one TCP connection◆ Serialize transfers Æ client makes next request only after previous responsez How to demultiplex requests/responses◆ Content-length and delimiter ◆ Block-based transmission – send in multiple length delimited blocks◆ Store-and-forward – wait for entire response and then use content-lengthMay 9, 2004 CSE 123b – Lecture 11 -- DNS 18Persistent Connection Persistent Connection ExampleExampleClientServerACKACKDATDATACK0 RTT1 RTT2 RTTServer reads from diskClient sends HTTP request for HTMLClient parses HTMLClient sends HTTP request for imageImage begins to arriveDATServer reads from diskDATMay 9, 2004 CSE 123b – Lecture 11 -- DNS 19Persistent Connection Persistent Connection PerformancePerformancez Benefits greatest for small objects◆ Up to 2x improvement in response timez Server resource utilization reduce due to fewer connection establishments and fewer active connectionsz TCP behavior improved◆ Longer connections help adaptation to available bandwidth◆ Larger congestion window


View Full Document

UCSD CSE 123B - HTTP

Download HTTP
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 HTTP 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 HTTP 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?