Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications

Similar documents
Web, HTTP and Web Caching

Lecture 6 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CMSC 332 Computer Networking Web and FTP

Review of Previous Lecture

1-1. Switching Networks (Fall 2010) EE 586 Communication and. September Lecture 10

Computer Networks. Wenzhong Li. Nanjing University

WWW: the http protocol

HyperText Transfer Protocol

Chapter 2: Application Layer. Chapter 2 Application Layer. Some network apps. Application architectures. Chapter 2: Application layer

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Applications & Application-Layer Protocols: The Web & HTTP

Application Layer. Applications and application-layer protocols. Goals:

Chapter 2 Application Layer

CS4/MSc Computer Networking. Lecture 3: The Application Layer

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

CS 43: Computer Networks. HTTP September 10, 2018

Application Protocols and HTTP

Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment

HTTP Reading: Section and COS 461: Computer Networks Spring 2013

Application Layer: The Web and HTTP Sec 2.2 Prof Lina Battestilli Fall 2017

Foundations of Telematics

Chapter 2. Application Layer. Chapter 2: Application Layer. Application layer - Overview. Some network apps. Creating a network appication

SCS3004 Networking Technologies Application Layer Protocols

DATA COMMUNICATOIN NETWORKING

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Application Level Protocols

EECS 3214: Computer Network Protocols and Applications

Lecture 04: Application Layer (Part 01) Principles and the World Wide Web (HTTP) Dr. Anis Koubaa

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Chapter 2 Application Layer

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Networking. Layered Model. DoD Model. Application Layer. ISO/OSI Model

Application Layer: HTTP

Multi-threaded Web Server (Assignment 1) Georgios Georgiadis

HTTP Review. Carey Williamson Department of Computer Science University of Calgary

CSC 4900 Computer Networks:

COSC 2206 Internet Tools. The HTTP Protocol

CSE 333 Lecture HTTP

Lab 2. All datagrams related to favicon.ico had been ignored. Diagram 1. Diagram 2

Announcements. The World Wide Web. Retrieving From the Server. Goals of Today s Lecture. The World Wide Web. POP3 Protocol

The World Wide Web. EE 122: Intro to Communication Networks. Fall 2006 (MW 4-5:30 in Donner 155) Vern Paxson TAs: Dilip Antony Joseph and Sukun Kim

Lecture 3. HTTP v1.0 application layer protocol. into details. HTTP 1.0: RFC 1945, T. Berners-Lee HTTP 1.1: RFC 2068, 2616

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca

Layered Model. DoD Model. ISO/OSI Model

Outline Computer Networking. HTTP Basics (Review) How to Mark End of Message? (Review)

How to work with HTTP requests and responses

Assignment, part 2. Statement and concepts INFO-0010

CMPE 151: Network Administration. Servers

Web Technology. COMP476 Networked Computer Systems. Hypertext and Hypermedia. Document Representation. Client-Server Paradigm.

Applications & Application-Layer Protocols: The Web & HTTP

COSC4377. Chapter 2: Outline

Chapter 2: Application layer

CSCD 330 Network Programming Spring 2018

Chapter 2 Application Layer

Internet Architecture. Web Programming - 2 (Ref: Chapter 2) IP Software. IP Addressing. TCP/IP Basics. Client Server Basics. URL and MIME Types HTTP

CS 43: Computer Networks. Layering & HTTP September 7, 2018

Computer Systems and Networks

Introduc)on to Computer Networks

CSE 333 Lecture HTTP

Content Delivery on the Web: HTTP and CDNs

CSC358 Week 2. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Network Applications Principles of Network Applications

Internet Content Distribution

COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS. Web Access: HTTP Mehmet KORKMAZ

Hypertext Transport Protocol

Information Network Systems The application layer. Stephan Sigg

EE 122: HyperText Transfer Protocol (HTTP)

Notes beforehand... For more details: See the (online) presentation program.

3. WWW and HTTP. Fig.3.1 Architecture of WWW

DNS and HTTP. A High-Level Overview of how the Internet works

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

Hypertext Transport Protocol

Announcements. The World Wide Web. Goals of Today s Lecture. The World Wide Web HTML. Web Components

COMPUTER NETWORK. Homework #1. Due Date: March 29, 2017 in class

Chapter 2 Application Layer

The HTTP Protocol HTTP

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm

SC/CSE 3213 Winter Sebastian Magierowski York University CSE 3213, W13 L8: TCP/IP. Outline. Forwarding over network and data link layers

Hypertext Transport Protocol HTTP/1.1

2/13/2014. A protocol is an agreed-upon convention that defines how communication occurs between two (or more?) endpoints

HTTP and Web Content Delivery

WWW Document Technologies

Application Layer Introduction; HTTP; FTP

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

Application Layer Chapter 2

WEB TECHNOLOGIES CHAPTER 1

Lecture Overview : Computer Networking. Applications and Application-Layer Protocols. Client-Server Paradigm

HTTP Protocol and Server-Side Basics

World Wide Web, etc.

REST. Lecture BigData Analytics. Julian M. Kunkel. University of Hamburg / German Climate Computing Center (DKRZ)

CS631 - Advanced Programming in the UNIX Environment

Computer Networks and Applications

World Wide Web. Before WWW

HTTP Server Application

Transcription:

Internet and Intranet Protocols and Applications Lecture 7b: HTTP Feb. 24, 2004 Arthur Goldberg Computer Science Department New York University artg@cs.nyu.edu

WWW - HTTP/1.1 Web s application layer protocol Client/server model client: browser that requests, receives, displays Web objects server: Web server sends objects in response to requests HTTP1.0: RFC 1945 HTTP1.1: RFC 2068, 2616 2/24/04 2

HTTP Connections Client initiates TCP connection (creates socket) to server, typically port 80 Server accepts TCP connection from client HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed

HTTP Example Suppose user enters URL www.someschool.edu/somedepartment/home.index (contains text, references to 10 jpeg mages) time 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someschool.edu. Port 80 is default for HTTP server. 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket 1b. HTTP server at host www.someschool.edu waiting for TCP connection at port 80. accepts connection, notifying client 3. HTTP server receives request message, forms response message containing requested object (somedepartment/home.index), sends message into socket

HTTP Example (cont.) 4. HTTP server closes TCP connection. time 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects

HTTP Request Message: General Format

HTTP Message Format: Request Two types of HTTP messages: request, response HTTP request message: ASCII (human-readable format) request line header lines indicates end of message GET /somedir/page.html HTTP/1.0 User-agent: Mozilla/4.0 Accept: text/html, image/gif,image/jpeg Accept-language:fr (extra carriage return, line feed)

HTTP Message Format: Response status line (protocol status code status phrase) data, e.g., requested html file header lines HTTP/1.0 200 OK Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998... Content-Length: 6821 Content-Type: text/html data data data data data...

Raw HTTP is Stateless Server maintains no information about past client requests Protocols that maintain state are complex past history (state) must be maintained if server or client crashes, their views of state may be inconsistent, must be reconciled Cookies maintain state

Non-persistent and Persistent Connections HTTP 1.0 uses non-persistent connections Browser makes connection and request for each object Server parses request, responds, and closes connection Performance problems Each object transfer suffers from TCP slow start Server load HTTP/1.1 uses persistent connections On same TCP connection: server, parses request, responds, parses new request... Client sends requests for all referenced objects as soon as it receives base HTML. Improves performance.

HTTP 1.1 Persistent Connections In previous example, a connection is made for each request. This is bad. Why? TCP 3-way hand-shake TCP slow start In HTTP 1.1, persistent connections were added as default behavior. Connection stays open unless client or server specify close when request satisfied with the header: Connection: close

HTTP 1.1 Pipelining Persistent connection improves performance some, but connection half session is still underutilized. Client sends request, then waits for response Server sends response, the waits for new request Pipelining - send next request before previous response is received. Studies show that persistent connections alone perform poorly. Pipelining improves performance considerably. (See Henrik Nielsen, et. al., Network Performance Effects of HTTP/1.1, CSS1, and PNG, ACM SIGCOMM '97.)

How s Pipelining Work How s the recipient identify the end of a message? What if a program s producing the message? Does the whole message need to be buffered to determine its length before anything can be sent?

HTTP Request Methods First word in HTTP request is method HTTP 1.1 methods are: GET (retrieve a resource) HEAD (retrieve info about resource) POST (submit an html form) PUT (create/modify resources) DELETE (delete a resource) TRACE (trace requests in proxy chains) OPTIONS (request for settings from proxy or server)

HTTP Headers Headers appear in requests and response to provide more information about the request or response. Formatting follows RFC 822, Section 3.1 Name : Value Header types General headers Request headers Response headers Entity headers (optional)

HTTP Response Format Responses have similar structure to request. Response format: HTTP/version status-code reason-text General headers Response headers Entity headers (optional) blank line resource entity (if any)

General Headers Can be present in request or response Cache-Control: control resource caching Connection: specify connection options Date: time of request/response Transfer-Encoding: indicate message has been transformed ( chunked is only option) Via: show hosts through which request or response has passed

Request Headers Meaningful only in requests. Important headers are: Accept: client tells server what media types are acceptable (e.g., text/html) Host: specifies host and port number for URL If-Modified-Since: used when performing conditional GET User-Agent: reports client software name and version. Lets run HTTP and look at some headers.

Response Headers Accept-Ranges: indicates server is capable of responding to range requests (e.g., byte range requests) Age: typically, the age of a cached object Location: used to indicate re-direction destination Server: identifies the server software that generated the response WWW-Authenticate: authentication challenge sent to client with 401 Unauthorized response

Authentication Server sends 401 response Browser opens userid / password dialog User enters info Browser sends Authorization: Basic base64-user-pass user-pass = userid ":" password When would this be insecure? How could it be made secure?

Entity Headers Carry meta information about the requested resource. Content-Base: defines base URL for relative URL in this document. Content-Encoding: indicates encoding of entity (e.g., gzip or compress) Content-Length: length of entity in bytes Content-Type: media type of entity (e.g., text/html, image/gif, etc) Expires: date/time at which entity expires (is no longer valid) Last-Modified: when entity modified on origin server

HTTP Response Status Codes Successful 2xx 200 OK Redirection 3xx 301 Moved permanently 304 Not modified Client Error 4xx 400 Bad request 401 Unauthorized 404 Not found Server Error 5xx 504 Gateway time-out 505 HTTP version not supported

Server design issues Functionality Handle multiple clients concurrently Maintaining client-specific state at a server (usually)» Reduce message sizes» Require fault-tolerance Access control» Authenticate clients» Evaluate whether client is allowed access» Secure data Robustness Performance Reliability 23