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

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

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

Computer Networks. Wenzhong Li. Nanjing University

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

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

Applications & Application-Layer Protocols: The Web & HTTP

HyperText Transfer Protocol

Web, HTTP and Web Caching

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

Application Level Protocols

Lecture Overview. Lecture 3 Design Philosophy & Applications. Internet Architecture. Priorities

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

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

HTTP and Web Content Delivery

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

Internet Content Distribution

Web. Computer Organization 4/16/2015. CSC252 - Spring Web and HTTP. URLs. Kai Shen

CS 43: Computer Networks. HTTP September 10, 2018

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

COSC 2206 Internet Tools. The HTTP Protocol

Application Protocols and HTTP

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca

CSE 333 Lecture HTTP

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

Hypertext Transport Protocol

Page # Lecture Overview. Lecture 3 Design Philosophy & Applications. Internet Architecture. Priorities. Survivability.

Application Layer Introduction; HTTP; FTP

How to work with HTTP requests and responses

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

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

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

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

Applications & Application-Layer Protocols: The Web & HTTP

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

CSE 333 Lecture HTTP

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

Review of Previous Lecture

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

The HTTP Protocol HTTP

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

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

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy

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

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

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

CMSC 332 Computer Networking Web and FTP

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

Content Delivery on the Web: HTTP and CDNs

EE 122: HyperText Transfer Protocol (HTTP)

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

Application Layer: HTTP

DATA COMMUNICATOIN NETWORKING

Introduc)on to Computer Networks

Assignment, part 2. Statement and concepts INFO-0010

Chapter 2 Application Layer

LAMP, WEB ARCHITECTURE, AND HTTP

SIP Compliance APPENDIX

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

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

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

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

World Wide Web. Before WWW

Project 2 Implementing a Simple HTTP Web Proxy

Introduction to Cisco TV CDS Software APIs

WWW: the http protocol

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

Project 2 Group Project Implementing a Simple HTTP Web Proxy

Giving credit where credit is due

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

CS631 - Advanced Programming in the UNIX Environment

ECE697AA Lecture 2. Today s lecture

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

Chapter 2. Application Layer

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

INF5750. RESTful Web Services

HTTP Security. CSC 482/582: Computer Security Slide #1

Layered Model. DoD Model. ISO/OSI Model

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

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

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

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

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

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers

EECS 3214: Computer Network Protocols and Applications

How to Configure SSL VPN Portal for Forcepoint NGFW TECHNICAL DOCUMENT

Architecture of the World Wide Web Web Informa4on Systems. CS/INFO 431 January 30, 2008 Carl Lagoze Spring 2008

Chapter 2 Application Layer

Header Status Codes Cheat Sheet

HTTP Protocol and Server-Side Basics

Advanced Java Programming. Networking

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

COSC4377. Chapter 2: Outline

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

Detects Potential Problems. Customizable Data Columns. Support for International Characters

8/8/17. HTTP Overview. It s all about the network. If you want to really do Web programming right you will need to know the ins and outs of HTTP

SCS3004 Networking Technologies Application Layer Protocols

Hypertext Transport Protocol

Information About SIP Compliance with RFC 3261

Transcription:

HTTP Reading: Section 9.1.2 and 9.4.3 COS 461: Computer Networks Spring 2013 1

Recap: Client-Server Communication Client sometimes on Initiates a request to the server when interested E.g., Web browser on your laptop or cell phone Doesn t communicate directly with other clients Needs to know server s address Server is always on Handles services requests from many client hosts E.g., Web server for the www.cnn.com Web site Doesn t initiate contact with the clients Needs fixed, known address 2

Outline HTTP overview Proxies 3

Two Forms of Header Formats Fixed: Every field (type, length) defined Fast parsing (good for hardware implementations) Not human readable Fairly static (IPv6 ~20 years to deploy) E.g., Ethernet, IP, TCP headers Variable length headers Slower parsing (hard to implement in hardware) Human readable Extensible E.g., HTTP (Web), SMTP (Email), XML 4

HTTP Basics (Overview) HTTP over bidirectional byte stream (e.g. TCP) Interaction Client looks up host (DNS) Client sends request to server Server responds with data or error Requests/responses are encoded in text Stateless HTTP maintains no info about past client requests HTTP Cookies allow server to identify client and associate requests into a client session 5

HTTP Request cr is \r lf is \n sp is 6

Request line HTTP Request 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 7

HTTP Request (cont.) Request headers Variable length, human-readable Uses: 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 8

HTTP Response 11

HTTP Response Status-line HTTP version (now 1.1 ) 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 12

HTTP Response (cont.) Headers Variable length, human-readable Uses: 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 (caching) Last-Modified (caching) Blank-line Body 13

HTTP Response Example HTTP/1.1 200 OK Date: Tue, 27 Mar 2001 03:49:38 GMT Server: 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.24 Last-Modified: Mon, 29 Jan 2001 17:54:18 GMT Accept-Ranges: bytes Content-Length: 4333 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html.. 14

How to Mark End of Message? Close connection Only server can do this One request per TCP connection. Hurts performance. Content-Length Must know size of transfer in advance No body content. Double CRLF marks end E.g., 304 never have body content Transfer-Encoding: chunked (HTTP/1.1) After headers, each chunk is content length in hex, CRLF, then body. Final chunk is length 0. 15

Example: Chunked Encoding HTTP/1.1 200 OK <CRLF> Transfer-Encoding: chunked <CRLF> <CRLF> 25 <CRLF> This is the data in the first chunk <CRLF> 1A <CRLF> and this is the second one <CRLF> 0 <CRLF> Especially useful for dynamically-generated content, as length is not a priori known Server would otherwise need to cache data until done generating, and then go back and fill-in length header before 16

Outline HTTP overview Proxies 17

Proxies End host that acts a broker between client and server Speaks to server on client s behalf Why? Privacy Content filtering Can use caching (coming up) 18

Proxies (Cont.) Accept requests from multiple clients Takes request and reissues it to server Takes response and forwards to client client client HTTP request HTTP response HTTP request HTTP response Proxy server HTTP request HTTP response origin server origin server 19

Assignment 1: Requirements Non-caching, HTTP 1.0 proxy Support only GET requests No persistent connections: 1 HTTP request per TCP connection Multi-process: use fork() Simple binary that takes a port number./proxy 12345 (proxy listens on port 12345) Work in Firefox & Chrome Use settings to point browser to your proxy 20

Assignment 1: Requirements What you need from a client request: host, port, and URI path GET http://www.princeton.edu:80/ HTTP/1.0 What you send to a remote server: GET / HTTP/1.0 Host: www.princeton.edu:80 Connection: close Check request line and header format Forward the response to the client 21

Why Absolute vs. Relative URLs? First there was one domain per server GET /index.html Then proxies introduced Need to specify which server GET http://www.cs.princeton.edu/index.hml Then virtual hosting: multiple domains per server GET /index.html Host: www.cs.princeton.edu Absolute URL still exists for historical reasons and backward compatibility 22

Assignment 1: Requirements Non-GET request? return Not Implemented (code 501) Unparseable request? return Bad Request (code 400) Use provided parsing library 23

Advice Networking is hard Hard to know what s going on in network layers Start out simple, test often Build in steps Incrementally add pieces Make sure they work Will help reduce the effect of incomplete information Assume teaching staff is non malicious or trying to trick you 24

Assignment 1 Getting Started Modify Assn 0 to have server respond Simple echo of what client sent Modify Assn 0 to handle concurrent clients Use fork() Create proxy server Simply repeats client msg to a server, and repeats server msg back Client sends HTTP requests, proxy parses 25

Summary HTTP: Simple text-based file exchange protocol Support for status/error responses, authentication, client-side state maintenance, cache maintenance How to improve performance Proxies Caching Persistent connections (more later) 33

Pop Quiz! Advantage of fast retransmit over timeouts? When are fast retransmits possible? When are timeouts particularly expensive? 34