CSE 333 Lecture HTTP

Similar documents
CSE 333 Lecture HTTP

Hypertext Transport Protocol

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

Application Protocols and HTTP

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

EDA095 HTTP. Pierre Nugues. March 30, Lund University

CS 43: Computer Networks. HTTP September 10, 2018

Introduction to HTTP. Jonathan Sillito

HyperText Transfer Protocol

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

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

CSCI-1680 WWW Rodrigo Fonseca

Applications & Application-Layer Protocols: The Web & HTTP

Computer Systems and Networks

Web, HTTP and Web Caching

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

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

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

Wire Shark Lab1. Intro

Computer Networks. Wenzhong Li. Nanjing University

Applications & Application-Layer Protocols: The Web & HTTP

Review of Previous Lecture

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

2- Application Level Protocols HTTP 1.0/1.1/2

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

White Paper: Next-Gen Network Traffic Analysis (NTA): Log-based NTA vs. Packet-based NTA

CS 455/555 Spring 2011 Weigle

CSCI-1680 WWW Rodrigo Fonseca

CSE 333 Lecture server sockets

Chapter 2 Application Layer

Introduc)on to Computer Networks

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

CSE 333 Lecture server sockets

DATA COMMUNICATOIN NETWORKING

CMSC 332 Computer Networking Web and FTP

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

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

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

CORS Attacks. Author: Milad Khoshdel Blog: P a g e. CORS Attacks

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

Application Level Protocols

CS193i Handout #18. HTTP Part 5

HTTP Server Application

HTTP, circa HTTP protocol. GET /foo/bar.html HTTP/1.1. Sviluppo App Web 2015/ Intro 3/3/2016. Marco Tarini, Uninsubria 1

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

SIP Session Initiation Protocol

ECE697AA Lecture 2. Today s lecture

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

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

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

jquery Basic HTTP communication

How to work with HTTP requests and responses

COSC 2206 Internet Tools. The HTTP Protocol

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

Application Layer: HTTP

LAMP, WEB ARCHITECTURE, AND HTTP

C22: Browser & Web Server Communication

Homework 2 50 points. CSE422 Computer Networking Spring 2018

Networking: Application Layer

HTTP and Web Content Delivery

Networking Fundamentals

CSE 333 Lecture server sockets

Proxying. Why and How. Alon Altman. Haifa Linux Club. Proxying p.1/24

INF5750. RESTful Web Services

Chapter 2 Application Layer

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

Computer Networks. HTTP and more. Jianping Pan Spring /20/17 CSC361 1

Internet Content Distribution

Networking. INFO/CSE 100, Spring 2006 Fluency in Information Technology.

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

Giving credit where credit is due

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

Information Network Systems The application layer. Stephan Sigg

Networking Fundamentals

Policies to Resolve Archived HTTP Redirection

EECS 3214: Computer Network Protocols and Applications

powered by Series of Tubes Senator Ted Stevens talking about the Net Neutrality Bill Jul 17, powered by

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

Web Client And Server

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

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

Introduction to Internet, Web, and TCP/IP Protocols SEEM

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

HTTP TRAFFIC CONSISTS OF REQUESTS AND RESPONSES. All HTTP traffic can be

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

TACACS Support APIs. curl -k -v -u "admin:cisco123" -H Accept:application/vnd.yang.data+xml -H ContentType:application/vnd.yang.

Application Layer Introduction; HTTP; FTP

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

90 Minute Optimization Life Cycle

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

162 HW2. David Culler, Arka Bhattacharya, William Liu. September 2014

Last Lecture. methods. ! How to send data from end to end: two switching. ! Packet loss and delay in a packet switched network. !

Computer Networks - A Simple HTTP proxy -

Announcements Fawzi Emad, Computer Science Department, UMCP

Browser behavior can be quite complex, using more HTTP features than the basic exchange, this trace will show us how much gets transferred.

WWW Document Technologies

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

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

HTTP HyperText Transfer Protocol

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

Transcription:

CSE 333 Lecture 19 -- HTTP Hal Perkins Department of Computer Science & Engineering University of Washington

Administrivia Server-side programming exercise due Wed. morning HW4 due a week later - How s it look? Today: http, end of networking/web Rest of the quarter: concurrency, threads, and processes - including a pthreads tutorial/demo in section this week

Let s dive down into HTTP I d like foo.html Found it, here it is: (foo.html) A client establishes one or more TCP connections to a server - the client sends a request for a web object over a connection, and the server replies with the object s contents - we have to figure out how let the client and server communicate their intentions to each other clearly - we have to define a protocol

HTTP is a protocol Protocol: the rules governing the exchange of messages, and the format of those messages, in a computing system - what messages can a client exchange with a server? what do the messages mean? what are legal replies to a message? what is the syntax of a message? - what sequence of messages is legal? how are errors conveyed? A protocol is (roughly) the network equivalent of an API

HTTP Hypertext transport protocol - a request / response protocol a client (web browser) sends a request to a web server the server processes the request, sends a response - typically, a request asks the server to retrieve a resource a resource is an object or document, named by a URI - a response indicates whether the server succeeded and, if so, it provides the content of the requested response

An HTTP request [METHOD] [request-uri] HTTP/[version]\r\n [fieldname1]: [fieldvalue1]\r\n [fieldname2]: [fieldvalue2]\r\n [...] [fieldnamen]: [fieldvaluen]\r\n \r\n [request body, if any] let s use nc to see a real request

HTTP methods There are three commonly used HTTP methods - GET: please send me the named document - POST: I d like to submit data to you, such as a file upload - HEAD: send me the headers for the named object, but not the object. (I d like to see if my cached copy is still valid.) There are several rarely used methods: - PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH,... TRACE: if there are any proxies or caches in between me and the server, please speak up!

HTTP versions Most browsers and servers speak HTTP/1.1 - version 1.1 of the HTTP protocol http://www.w3.org/protocols/rfc2616/rfc2616.html - introduced around 1996 to fix shortcomings of HTTP/1.0 better performance, richer caching features, better support for multi-homed servers, and much more more complicated to implement than HTTP/1.0

Client headers The client can provide zero or more request headers - they provide information to the server, or modify how the server should process the request You ll encounter many in practice - Host: the DNS name of the server [why?] - User-Agent: an identifying string naming the browser [why?] - Accept: the content types the client prefers or can accept - Cookie: an HTTP cookie previously set by the server

Example... GET /foo/bar.html HTTP/1.1 Host: futureproof.cs.washington.edu:5555 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/ 536.26.17 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 Accept-Language: en-us Accept-Encoding: gzip, deflate Cookie: utma=59807807.1547453334.1214335349.1301330421.1301339949. 30; utmz=59807807.1300728257.27.14.utmcsr=google utmccn=(organic) utmcmd=organic utmctr=csgordon@u.washington.edu; utma=80390417.1521666831.1201286098.1302710464.1302717901.34; utmz=80390417.1301950604.31.15.utmcsr=cs.washington.edu utmccn=(referral) utmcmd=referral utmcct=/education/courses/ cse333/11sp/; qca=p0-1872143622-1294952393928 Connection: keep-alive

An HTTP response HTTP/[version] [status code] [reason]\r\n [fieldname1]: [fieldvalue1]\r\n [fieldname2]: [fieldvalue2]\r\n [...] [fieldnamen]: [fieldvaluen]\r\n \r\n [response body, if any] let s use telnet to see a real response

Status codes, reason phrase Code: a computer-readable outcome of the request - three digit integer; first digit identifies the response category 1xx: some kind of informational message 2xx: success of some kind 3xx: redirects the client to a different URL 4xx: the client s request contained some error 5xx: the server experienced an error Reason phrase: human-readable explanation - e.g., OK or Moved Temporarily

Common status lines HTTP/1.1 200 OK - the request succeeded, the requested object is sent HTTP/1.1 404 Not Found - the requested object was not found HTTP/1.1 301 Moved Permanently - the object exists, but its name has changed - the new URL is given in the Location: header HTTP/1.1 500 Server Error - the server had some kind of unexpected error

Server headers The server can provide zero or more response headers - they provide information to the client, or modify how the client should process the response You ll encounter many in practice - Server: a string identifying the server software [why?] - Content-Type: the type of the requested object - Content-Length: size of requested object [why?] - Last-Modified: a date indicating the last time the request object was modified [why?]

Example HTTP/1.1 200 OK Date: Fri, 27 May 2011 17:05:53 GMT Server: Apache/2.2.19 (Fedora) Last-Modified: Fri, 27 May 2011 17:04:51 GMT ETag: "2740640-52-4a444ef9392c0" Accept-Ranges: bytes Content-Length: 82 Content-Type: text/html Content-Language: en <html><body> <font color="chartreuse" size="18pt">awesome!!</font> </body></html>

Cool HTTP/1.1 features Chunked Transfer-Encoding - a server might not know how big a response object is e.g., you re dynamically generating the content in response to a query or other user input - how do you send Content-Length? could wait until you ve finished generating the response, but that s not great in terms of latency instead, want to start sending response right away - chunked message body: response is series of chunks try with http://www.cs.washington.edu/

Cool HTTP/1.1 features Persistent connections - establishing a TCP connection is costly multiple network round trips just to set up the TCP connection TCP has a feature called slow start ; slowly grows the rate at which a TCP connection transmits to avoid overwhelming networks - a web page consists of multiple objects, and a client probably visits several pages on the same server bad idea: separate TCP connection for each object better idea: single TCP connection, multiple requests try it on www.cs.washington.edu

See you on Wednesday!