HTTP request message: general format

Slides:



Advertisements
Similar presentations
HTTP Cookies. CPSC Application Layer 2 User-server state: cookies Many major Web sites use cookies Four components: 1) cookie header line of HTTP.
Advertisements

HyperText Transfer Protocol (HTTP)
1 Caching in HTTP Representation and Management of Data on the Internet.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chapter 2: Application Layer
EEC-484/584 Computer Networks Discussion Session for HTTP and DNS Wenbing Zhao
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
What’s a Web Cache? Why do people use them? Web cache location Web cache purpose There are two main reasons that Web cache are used:  to reduce latency.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Week 11: Application Layer1 Week 11: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Web, HTTP and Web Caching
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
1 K. Salah Module 2.1: Application Layer Application-level protocols provide high-level services –Web and HTTP –DNS –Electronic mail –Remote login –FTP.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
2: Application Layer World Wide Web (WWW). Introduction 1-2 Internet protocol stack (recap) r application: supporting network applications m FTP,
Krerk Piromsopa. Web Caching Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.
Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger.
Mail (smtp), VoIP (sip, rtp)
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
20-1 Last time □ NAT □ Application layer ♦ Intro ♦ Web / HTTP.
Week 11: Application Layer1 Web and HTTP First some jargon r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,…
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Introduction 1 Lecture 6 Application Layer (HTTP) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
2: Application Layer1 Web and HTTP First some jargon Web page consists of base HTML-file which includes several referenced objects Object can be HTML file,
2: Application Layer1 Chapter 2 Application Layer Part 2: Web & HTTP These slides derived from Computer Networking: A Top Down Approach, 6 th edition.
2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket.
1 HTTP EECS 325/425, Fall 2005 September Chapter 2: Application layer r 2.1 Principles of network applications m app architectures m app requirements.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 8 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Application Layer 2-1 Chapter 2 Application Layer 2.2 Web and HTTP.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April.
Dr. Philip Cannata 1 The Web and HTTP. Dr. Philip Cannata 2 Application Layer 2-2 Chapter 2 Application Layer Computer Networking: A Top Down Approach.
Application Layer 2-1 Lecture 4: Web and HTTP. Web and HTTP First, a review… web page consists of objects object can be HTML file, JPEG image, Java applet,
Important r There will be NO CLASS on Friday 1/30/2015! r Please mark you calendars 1.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Week 11: Application Layer 1 Web and HTTP r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Lecture 5 Internet Core: Protocol layers. Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP 
2: Application Layer 1 Chapter 2 Application Layer These ppt slides are originally from the Kurose and Ross’s book. But some slides are deleted and added.
Introduction to Networks
Chapter 2: Application Layer
Block 5: An application layer protocol: HTTP
04 - World Wide Web (WWW) 2: Application Layer.
Caching Temporary storage of frequently accessed data (duplicating original data stored somewhere else) Reduces access time/latency for clients Reduces.
Internet transport protocols services
Chapter 2: Application layer
Session 4 INST 346 Technologies, Infrastructure and Architecture
Web Caching? Web Caching:.
Chapter 2: Application layer
Internet Applications
ECE 671 – Lecture 16 Content Distribution Networks
EEC-484/584 Computer Networks
لایه ی کاربرد مظفر بگ محمدی 2: Application Layer.
Chapter 2: Application layer
CS 5565 Network Architecture and Protocols
EEC-484/584 Computer Networks
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
The Application Layer: HTTP
Application Layer Part 1
Chapter 2 Application Layer
CS1652 September 4th, 2012 Jack Lange University of Pittsburgh
Presentation transcript:

HTTP request message: general format

Uploading form input Post method: Web page often includes form input Input is uploaded to server in entity body URL method: Uses GET method Input is uploaded in URL field of request line: www.somesite.com/animalsearch?monkeys&banana

Method types HTTP/1.0 GET POST HEAD HTTP/1.1 GET, POST, HEAD PUT asks server to leave requested object out of response HTTP/1.1 GET, POST, HEAD PUT uploads file in entity body to path specified in URL field DELETE deletes file specified in the URL field

HTTP response message status line (protocol status code status phrase) header lines data, e.g., requested HTML file Data………………….

HTTP response status codes In first line in server->client response message. A few sample codes: 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported

User-server state: cookies Many major Web sites use cookies Four components: 1) cookie header line in the HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host and managed by user’s browser 4) back-end database at Web site Example: Susan access Internet always from same PC She visits a specific e- commerce site for first time When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID

Cookies: keeping “state” (cont.) client server usual http request msg usual http response + Set-cookie: 1678 cookie: 1678 usual http response msg cookie- specific action spectific Cookie file ebay: 8734 server creates ID 1678 for user entry in backend database Cookie file amazon: 1678 ebay: 8734 access one week later: access Cookie file amazon: 1678 ebay: 8734

Cookies (continued) Cookies and privacy: aside Cookies and privacy: cookies permit sites to learn a lot about you you may supply name and e-mail to sites search engines use redirection & cookies to learn yet more advertising companies obtain info across sites What cookies can bring: authorization shopping carts recommendations user session state (Web e-mail) Do cookies compromise security? Can it be used for authentication?

Web caches (proxy server) Goal: satisfy client request without involving origin server user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client origin server Proxy server HTTP request HTTP request client HTTP response HTTP response HTTP request HTTP response client origin server Your Web request may be intercepted using a transparent TCP proxy!

More about Web caching Cache acts as both client and server Typically cache is installed by ISP (university, company, residential ISP) Why Web caching? Reduce response time for client request. Reduce traffic on an institution’s access link. Internet dense with caches enables “poor” content providers to effectively deliver content (but so does P2P file sharing)

Types of Web Caches User Agent Cache (Browser Cache) Single user Shared Cache (Proxy Cache) Multi-user Gateway Cache

Caching example Assumptions origin average object size = 100,000 bits avg. request rate from institution’s browsers to origin servers = 15/sec delay from institutional router to any origin server and back to router = 2 sec Consequences utilization on LAN = 1.5Mbps/10Mbps = 15% utilization on access link = 100% total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + milliseconds origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps access link cache

Caching example (cont) origin servers Possible solution increase bandwidth of access link to, say, 10 Mbps Consequences utilization on LAN = 15% utilization on access link = 15% Total delay = Internet delay + access delay + LAN delay = 2 sec + msecs + msecs often a costly upgrade public Internet 10 Mbps access link institutional network 10 Mbps LAN institutional cache

Caching example (cont) origin servers Install cache suppose hit rate is 0.4 Consequence 40% requests will be satisfied almost immediately 60% requests satisfied by origin server utilization of access link reduced to 60%, resulting in negligible delays (say 10 msec) total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + milliseconds < 1.4 secs public Internet 1.5 Mbps access link institutional network 10 Mbps LAN institutional cache

Conditional GET server cache Goal: don’t send object if cache has up-to-date cached version cache: specify date of cached copy in HTTP request If-modified-since: <date> server: response contains no object if cached copy is up-to- date: HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date> object not modified HTTP response HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date> object modified HTTP response HTTP/1.0 200 OK <data>

Controlling Cache HTML Meta Tags HTTP Headers Written in <head> section of an HTML page. Can mark expiration date or as uncacheable. Only used by some browser caches and not seen by proxy caches. HTTP Headers Automatically created by Web server. Sent before HTML. Seen by browser and proxy caches.

HTTP Defining Mechanisms Freshness – Content is able to be loaded from cache without having to check with the original server. Validation – The process of confirming with the original server whether or not cached content is still valid to load.

HTTP Response Headers Example HTTP/1.1 200 OK Date: Fri, 30 Oct 2016 13:19:41 GMT Server: Apache/1.3.3 (Unix) Cache-Control: max-age=3600, must-revalidate Expires: Fri, 30 Oct 2016 14:19:41 GMT Last-Modified: Mon, 29 Jun 2016 02:28:12 GMT ETag: "3e86-410-3596fbbc" Content-Length: 1040 Content-Type: text/html Validation Freshness

Expires Header and Freshness Expires: Fri, 30 Oct 2016 14:19:41 GMT Indicates how long the representation is fresh. After this time passes, the cache will communicate with the original server to see if there have been any changes. Beneficial for static page images as well as continually changing content. Web server and cache must be synchronized.

Cache-Control Header and Freshness Cache-Control: max-age=3600, must-revalidate Gives control beyond Expires header. Cache control response-headers: max-age=[seconds] s-maxage=[seconds] public no-cache no-store must-revalidate proxy-revalidate

Last-Modified and Validation Last-Modified: Mon, 29 Jun 2016 02:28:12 GMT Validate cache by looking at the last time the document was altered (Last-Modified). If-Modified-Since request is sent to the original server. If changes have been made since the date given, the entire document is returned. Otherwise, the cached document can be loaded.

ETag and Validation Unique identifiers created by server. ETag: "3e86-410-3596fbbc" Unique identifiers created by server. Changed each time the representation is altered on the original server. If-None-Match, request is sent to server and a simple comparison is used to validate the content.

Content Delivery Network (CDN) 4a. Get embedded documents from local cache or server (if not already cached) Cache CDN server 4b. Embedded documents 5. Embedded documents 3. Get embedded documents 1. Get base documents Client Original server 2. Document with refs to embedded documents Cache producer within Akamai CDN

References Nottingham, Mark. “Caching Tutorial: for Web Authors and Webmasters.” July 2006. <http://www.mnot.net/cache_docs/>. Tanenbaum, Andrew S. Distributed Systems: Principles and Paradigms. New Jersey: Prentice- Hall, 2002. “Web cache.” Wikipedia. <http://en.wikipedia.org/wiki/Web_cache>.