CS 3214 Computer Systems Godmar Back Lecture 25. Announcements Project 5 due Dec 8 Exercise 10 due Nov 29 CS 3214 Fall 2010.

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

CSE534 – Fundamentals of Computer Networks Lecture 11: HTTP/Web (The Internet’s first killer app) Based on slides from Kurose + Ross, and Carey Williamson.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
HyperText Transfer Protocol (HTTP)
Application Layer-11 CSE401N: Computer Networks Lecture-4 Application Layer Overview HTTP.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
2: Application Layer1 Chapter 2: Application Layer Our goals: r conceptual, implementation aspects of network application protocols m transport-layer service.
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
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
9/16/2003-9/18/2003 The Application Layer and Java Programming September 16-18, 2003.
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
2: Application Layer1 Chapter 2: Application Layer Our goals: r conceptual, implementation aspects of network application protocols m transport-layer service.
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.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CS 6204 Cloud Environments Godmar Back. Announcements Please sign up for Piazza CS 6204 Choose first topic from list CS 6204 Spring 2014.
PL-IV- Group A HTTP Request & Response Header
2: Application Layer World Wide Web (WWW). Introduction 1-2 Internet protocol stack (recap) r application: supporting network applications m FTP,
1 Application Layer Lecture 4 Imran Ahmed University of Management & Technology.
CS 3830 Day 7 Introduction : Application Layer 2 Processes communicating Process: program running within a host. r within same host, two processes.
FTP (File Transfer Protocol) & Telnet
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.
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.
20-1 Last time □ NAT □ Application layer ♦ Intro ♦ Web / HTTP.
2: Application Layer1 Internet apps: their protocols and transport protocols Application remote terminal access Web file transfer streaming multimedia.
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,…
CS 372 – introduction to computer networks* Wednesday June 30
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.
1 Computer Communication & Networks Lecture 28 Application Layer: HTTP & WWW p Waleed Ejaz
Sockets process sends/receives messages to/from its 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.
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.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
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.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
Advance Computer Networks Lecture#05 Instructor: Engr. Muhammad Mateen Yaqoob.
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.
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.
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.
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.
Application Layer Dr. Adil Yousif Lecture 2 CS.
Block 5: An application layer protocol: HTTP
CS 3214 Introduction to Computer Systems
Internet transport protocols services
Computer Communication & Networks
EEC-484/584 Computer Networks
CS 5565 Network Architecture and Protocols
EEC-484/584 Computer Networks
The Application Layer: HTTP
Chapter 2 Application Layer
Presentation transcript:

CS 3214 Computer Systems Godmar Back Lecture 25

Announcements Project 5 due Dec 8 Exercise 10 due Nov 29 CS 3214 Fall 2010

NETWORKING Part 2 CS 3214 Fall 2010 Some of these slides are substantially derived from slides provided by Jim Kurose & Keith Ross. Copyright on this material is held by Kurose & Ross. Used with permission. The textbook is Computer Networking: A Top Down Approach Featuring the Internet Jim Kurose, Keith Ross, Addison-Wesley, July 2004Computer Networking: A Top Down Approach Featuring the Internet Jim Kurose, Keith Ross, Addison-Wesley, July 2004

Application Protocols HTTP

CS 3214 Fall 2010 Recall how the Web works Web page consists of objects Object can be HTML file, JPEG image, Java applet, audio file,… Web page consists of base HTML-file which includes several referenced objects Each object is addressable by a URL Example URL: host name path name

CS 3214 Fall 2010 HTTP Overview HTTP: hypertext transfer protocol 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 HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068 PC running Explorer Server running Apache Web server Mac running Firefox HTTP request HTTP response

CS 3214 Fall 2010 HTTP Overview (continued) Uses TCP: client initiates TCP connection (creates socket) to server, 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 is “stateless” server maintains no information about past client requests Protocols that maintain “state” are complex! past history (state) must be maintained if server/client crashes, their views of “state” may be inconsistent, must be reconciled aside

CS 3214 Fall 2010 Nonpersistent HTTP 1a. HTTP client initiates TCP connection to HTTP server (process) at on port HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object /~cs3214/index.html 1b. HTTP server at host waiting for TCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time (contains text, references to n images)

CS 3214 Fall 2010 Nonpersistent HTTP (cont.) 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds n referenced image objects 6. Steps 1-5 repeated for each of 10 image objects 4. HTTP server closes TCP connection. time

CS 3214 Fall 2010 Response time modeling Round Trip Time (RTT): time to send a small packet to travel from client to server and back. Response time: one RTT to initiate TCP connection one RTT for HTTP request and first few bytes of HTTP response to return file transmission time total = 2RTT+transmit time time to transmit file initiate TCP connection RTT request file RTT file received time

CS 3214 Fall 2010 Persistent Connections Idea: reuse same connection to retrieve multiple objects Saves repeated connection establishment & teardown total = RTT+ N * (RTT + transmit time) time to transmit file initiate TCP connection RTT request file RTT File 1 received time RTT File 2 received RTT File 3 received

CS 3214 Fall 2010 Pipelining Idea: send next request before response for previous request arrives Server should receive next request even before last response is sent total = 3*RTT+ N * transmit time time to transmit file initiate TCP connection RTT request file RTT File 1 received time RTT File 2 received File 3 received

CS 3214 Fall 2010 Persistent HTTP Nonpersistent HTTP issues: requires 2 RTTs per object OS must work and allocate host resources for each TCP connection but browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP server leaves connection open after sending response subsequent HTTP messages between same client/server are sent over connection Persistent without pipelining: client issues new request only when previous response has been received one RTT for each referenced object Persistent with pipelining: default in HTTP/1.1 client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects

Pipelining In Practice Current browsers disable pipelining by default, preferring multiple persistent connections instead Reason: realizing latency advantages of pipelining is difficult, requires that server sends responses back to back with no bubble It’s easier for most server to commence processing of requests in parallel if they arrive on different connections –And responses can be sent as soon as they are ready See MacVittie 2009 for detailsMacVittie 2009 CS 3214 Fall 2010

HTTP Request Message two types of HTTP messages: request, response HTTP request message: –ASCII (human-readable format) GET /~cs3214/index.html HTTP/1.1 Host: User-agent: Lynx/2.8.4rel.1 Connection: close Accept-language: en, fr (extra carriage return, line feed) request line (GET, POST, HEAD commands) header lines Carriage return, line feed Only if non-persistent Needed because multiple sites may be hosted on same host

CS 3214 Fall 2010 HTTP Request Msg: general format

CS 3214 Fall 2010 Grammar Formulation HTTP-message = Request | Response Request = rfc822-generic-message Response = rfc822- generic-message rfc822- generic-message = start-line *(message-header CRLF) CRLF [ message-body ] start-line = Request-Line | Status-Line message-header = field-name ":" [ field-value ] Request-Line = Method SP Request-URI SP HTTP-Version CRLF

CS 3214 Fall 2010 Method types HTTP/1.0 GET POST HEAD –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

CS 3214 Fall 2010 Uploading Form Input POST method: …. Input is uploaded to server in entity body GET method: …. Uses GET method Input is uploaded in URL field Needs RFC 2396 encoding, e.g. “ “  %20 GET /form?username=Joe&… HTTP/1.1 Host: POST /form HTTP/1.1 Host: Content-Length: 12 username=Joe&…

CS 3214 Fall 2010 HTTP Response Message HTTP/ OK Connection: close Date: Thu, 06 Aug :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... status line (protocol status code status phrase) header lines data, e.g., requested HTML file Only if non-persistent

CS 3214 Fall 2010 HTTP Response Status 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 In first line in server->client response message. A few sample codes:

CS 3214 Fall 2010 Trying out HTTP (client side) for yourself 1. Telnet to your favorite Web server: Opens TCP connection to port 80 (default HTTP server port) at Anything typed is sent to port 80 at telnet Type in a GET HTTP request: GET / HTTP/1.1 Host: By typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server 3. Look at response message sent by HTTP server!

CS 3214 Fall 2010 Historical Note First version by Tim Berners-Lee –Aka HTTP/0.9 % telnet 80 Trying Connected to Escape character is '^]'. GET / ← I typed this + single CRLF Virginia Tech -- Home Page ….

CS 3214 Fall 2010 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 accesses 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

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

Mashups Web applications that combine and mix data from different sources CS 3214 Fall 2010

Client Browser Source A Source C Source B Server-side Mash-Up Mash-Up Server HTML C A Base Page B Base Server CS 3214 Fall 2010

Client Browser Source A Source C Source B Proxy-Based Mash-Up C A Base Page B Proxy Base Server HTML+JavaScript XMLHttpRequest CS 3214 Fall 2010

Client Browser Source A Source C Source B Client-side Mash-Up Base Server HTML+JavaScript C A XMLHttpRequest + XML/Text Same Origin Restriction + JSON XMLHttpRequest + XML/Text Same Domain Restriction No Domain Restriction Base Page B B (via hidden frame) CS 3214 Fall 2010

HTTP & JSON In modern web applications, HTTP is increasingly initiated from code –Either directly, e.g., XMLHttpRequest –Or indirectly, via SCRIPT/JSON Example: – ibkeys= &callback=callThisFunctionhttp://books.google.com/books?jscmd=viewapi&b ibkeys= &callback=callThisFunction CS 3214 Fall 2010 callThisFunction({" ":{"bib_key":" ", "info_url": " "preview_url": " preview":"noview", "embeddable":false}}); callThisFunction({" ":{"bib_key":" ", "info_url": " "preview_url": " preview":"noview", "embeddable":false}});

HTTP & AJAX AJAX Frameworks no longer build entire web pages from an HTML description Rather: bootstrap small amount of code, then dynamically load and update page “piece-by-piece” CS 3214 Fall 2010

Goal – Use of AJAX Conventional Navigation Model AJAX Navigation Model Page 1 Page 2 Page 3 Servlet 1 Servlet 2 Submit button pressed HTML Page returned Servlet 1-1 Servlet 1-2 Submit button pressed Mouse Hover Update portion of page Update Portion of Page CS 3214 Fall 2010

Server centric vs. Client centric AJAX frameworks Generated HTML+ JavaScript Client Side AJAX Engine Server Side AJAX Engine Web Application Application HTML+ JavaScript Client Side AJAX Engine Framework codeApplication CodeGenerated Code Dom Browser Server Server-Centric Client-Centric CS 3214 Fall 2010

Architectures and Protocol on top of HTTP REST: –Representational State Transfer –URL represent resources SOAP: –Remote-procedure call abstraction CS 3214 Fall 2010