Computer Networking Lecture 25-the web
Computer Networking Lecture 25 – The Web
Outline Http review and details(more in notes Persistenthttpreview Http caching Content distribution networks Lecture19:2006-11-02
Lecture 19: 2006-11-02 2 Outline • HTTP review and details (more in notes) • Persistent HTTP review • HTTP caching • Content distribution networks
Http Basics(review) Http layered over bidirectional byte stream Almost always TCP ·| nteraction Client sends request to server, followed by response from server to client Requests/responses are encoded in text Stateless Server maintains no information about past client requests Lecture19:2006-11-02 3
Lecture 19: 2006-11-02 3 HTTP Basics (Review) • HTTP layered over bidirectional byte stream • Almost always TCP • Interaction • Client sends request to server, followed by response from server to client • Requests/responses are encoded in text • Stateless • Server maintains no information about past client requests
How to Mark End of Message?(Review) Size of message Content-Length Must know size of transfer in advance Delimiter> MIME-style Content-Type Server must escape" delimiter in content Close connection Only server can do this Lecture19:2006-11-02
Lecture 19: 2006-11-02 4 How to Mark End of Message? (Review) • Size of message → Content-Length • Must know size of transfer in advance • Delimiter → MIME-style Content-Type • Server must “escape” delimiter in content • Close connection • Only server can do this
Http Request(review) equest line R Method GET- return URi HEAD-return headers only of Get response POST-send data to the server(forms, etc.) URL (relative) °Eg., index html Http Version Lecture19:2006-11-02 5
Lecture 19: 2006-11-02 5 HTTP Request (review) • Request line • Method • GET – return URI • HEAD – return headers only of GET response • POST – send data to the server (forms, etc.) • URL (relative) • E.g., /index.html • HTTP version
Http rEquest(cont. (review) Request headers Authorization-authentication info Acceptable document types/encodings From -user email If-Modified-Since Referrer -what caused this page to be requested User-Agent client software Blank-line Body Lecture19:2006-11-02
Lecture 19: 2006-11-02 6 HTTP Request (cont.) (review) • Request headers • Authorization – authentication info • Acceptable document types/encodings • From – user email • If-Modified-Since • Referrer – what caused this page to be requested • User-Agent – client software • Blank-line • Body
Http Request(review) method sp URL sp version cr If request line header field name value crIf header lines header field name value crIf cr If Entity Body Lecture19:2006-11-02
Lecture 19: 2006-11-02 7 HTTP Request (review)
Http Request ExamPle(review) Get/httP/1.1 Accept: * Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozillal40(compatible; MSIE 5.5; Windows NT 5.0) Hostwww.intel-iris.net Connection Keep-Alive Lecture19:2006-11-02
Lecture 19: 2006-11-02 8 HTTP Request Example (review) GET / HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: www.intel-iris.net Connection: Keep-Alive
Http Response(review) · Status|ine Http Version 3 digit response code 1XX-informational 2XX-success 200OK ·3xX- redirection 301 Moved Permanently 303 Moved Temporarily 304 Not modified 4XX- client error 404 Not found 5XX- server error 505 Http Version Not Supported Reason phrase Lecture19:2006-11-02
Lecture 19: 2006-11-02 9 HTTP Response (review) • Status-line • HTTP version • 3 digit response code • 1XX – informational • 2XX – success • 200 OK • 3XX – redirection • 301 Moved Permanently • 303 Moved Temporarily • 304 Not Modified • 4XX – client error • 404 Not Found • 5XX – server error • 505 HTTP Version Not Supported • Reason phrase
Http Response(cont. )(review) Headers Location -for redirection Server-server software WW-Authenticate- request for authentication Allow-list of methods supported(get, head, etc) Content-Encoding -E.g x-gzip Content-Lengti Content-Type Expires Last-Modified Blank-line Body Lecture19:2006-11-02
Lecture 19: 2006-11-02 10 HTTP Response (cont.) (review) • 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-Modified • Blank-line • Body