Proxy Lab Recitation I Monday Nov 20, 2006.

Slides:



Advertisements
Similar presentations
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Advertisements

HyperText Transfer Protocol (HTTP)
Chapter 9 Application Layer, HTTP Professor Rick Han University of Colorado at Boulder
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
How the web works: HTTP and CGI explained
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Web, HTTP and Web Caching
Definitions, Definitions, Definitions Lead to Understanding.
CS 142 Lecture Notes: HTTPSlide 1 HTTP Request GET /index.html HTTP/1.1 Host: User-Agent: Mozilla/5.0 Accept: text/html, */* Accept-Language:
1 K. Salah Module 2.1: Application Layer Application-level protocols provide high-level services –Web and HTTP –DNS –Electronic mail –Remote login –FTP.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
PL-IV- Group A HTTP Request & Response Header
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
Krerk Piromsopa. Web Caching Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.
HTTP Protocol Specification
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
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.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Application Layer 2 Figures from Kurose and Ross
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
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,…
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
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,
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
IT Engineering Instructor: Rezvan Shiravi
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
HyperText Transfer Protocol (HTTP) RICHI GUPTA CISC 856: TCP/IP and Upper Layer Protocols Fall 2007 Thanks to Dr. Amer, UDEL for some of the slides used.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
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.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
HTTP How the Internet servers and clients communicate.
Web Technologies Lecture 1 The Internet and HTTP.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
Summer 2007 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 1 – Introducing Ajax.
5 th ed: Chapter 17 4 th ed: Chapter 21
Overview of Servlets and JSP
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
Web Caching. Why Caching? Faster browsing experience for users Cache hit rate Traffic Prioritization Reduce network bandwidth requirements significantly.
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Bapi Chatterjee Prajith R G.
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.
Web Protocols: HTTP COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 2/13/06.
Hypertext Transfer Protocol (HTTP) COMP6218 Web Architecture Dr Nicholas Gibbins –
The Hypertext Transfer Protocol
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Presentation transcript:

Proxy Lab Recitation I Monday Nov 20, 2006

Outline What is a HTTP proxy? HTTP Tutorial HTTP Request HTTP Response Sequential vs. concurrent proxies Caching

What is a proxy? Proxy Client Server Why a proxy? Browser www.google.com Why a proxy? Access control (allowed websites) Filtering (viruses, for example) Caching (multiple people request CNN)

Brief HTTP Tutorial Hyper-Text Transfer Protocol Protocol spoken between a browser and a web-server From browser  web-server: REQUEST GET http://www.google.com/ HTTP/1.0 From web-server  browser: RESPONSE HTTP 200 OK Other stuff…

HTTP Request GET http://csapp.cs.cmu.edu/simple.html HTTP/1.1 Request Type Host Path Version GET http://csapp.cs.cmu.edu/simple.html HTTP/1.1 Host: csapp.cs.cmu.edu User-Agent: Mozilla/5.0 ... Accept: text/xml,application/xml ... Accept-Language: en-us,en;q=0.5 ... Accept-Encoding: gzip,deflate ... An empty line terminates a HTTP request

HTTP Request GET http://csapp.cs.cmu.edu/simple.html HTTP/1.1 Host: csapp.cs.cmu.edu User-Agent: Mozilla/5.0 ... Accept: text/xml,application/xml ... Accept-Language: en-us,en;q=0.5 ... Accept-Encoding: gzip,deflate ... The Host header is optional in HTTP/1.0 but we recommend that it be always included

HTTP Request GET http://csapp.cs.cmu.edu/simple.html HTTP/1.1 Host: csapp.cs.cmu.edu User-Agent: Mozilla/5.0 ... Accept: text/xml,application/xml ... Accept-Language: en-us,en;q=0.5 ... Accept-Encoding: gzip,deflate ... The User agent identifies the browser type. Some websites use it to determine what to send. And reject you if you say you use MyWeirdBrowser  Proxy must send this and all other headers through…

HTTP Response HTTP/1.1 200 OK Date: Mon, 20 Nov 2006 03:34:17 GMT Status HTTP/1.1 200 OK Date: Mon, 20 Nov 2006 03:34:17 GMT Server: Apache/1.3.19 (Unix) … Last-Modified: Mon, 28 Nov 2005 23:31:35 GMT Content-Length: 129 Connection: Keep-Alive Content-Type: text/html Status indicates whether it was successful or not, if it is a “redirect”, etc. The complete response should be transparently sent back to the client by the proxy.

HTTP Response HTTP/1.1 200 OK Date: Mon, 20 Nov 2006 03:34:17 GMT Server: Apache/1.3.19 (Unix) … Last-Modified: Mon, 28 Nov 2005 23:31:35 GMT Content-Length: 129 Connection: Keep-Alive Content-Type: text/html This field identifies how many bytes are there in the response. Not sent by all web-servers. DO NOT RELY ON IT !

Concurrent Proxy Need to handle multiple requests simultaneously From different clients From the same client E.g., each individual image in a HTML document needs to be requested separately Serving requests sequentially decreases throughput Server is waiting for I/O most of the time This time can be used to start serving other clients Multiple outstanding requests

Concurrent Proxy Use threads for making proxy concurrent Create one thread for each new client request The thread finishes and exists after serving the client request Use pthread library pthread_create(), pthread_detach(), etc. Can use select() as well for adding concurrency Much more difficult to get right

Caching Proxy Most geeks visit http://slashdot.org/ every 2 minutes Why fetch the same content again and again? (If it doesn’t change frequently) The proxy can cache responses Serve directly out of its cache Reduces latency, network-load

Caching: Implementation Issues Use the GET URL (host/path) to locate the appropriate cache entry THREAD SAFETY A single cache is accessed by multiple threads Easy to create bugs: thread 1 is reading an entry, while thread 2 is deleting the same entry

General advice Use RIO routines When to use strcpy() vs. memcpy() rio_readnb, rio_readlineb Be very careful when you are reading line-by-line (HTTP request), versus just a stream of bytes (HTTP response) When to use strcpy() vs. memcpy() gethostbyname(), inet_ntoa() are not thread-safe! Path: sequential  + concurrency  + caching