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

Similar documents
DATA COMMUNICATOIN NETWORKING

EECS 3214: Computer Network Protocols and Applications

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

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

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

Chapter 2: Application layer

CS 43: Computer Networks. HTTP September 10, 2018

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

Chapter 2 Application Layer

Chapter 2 Application Layer

Application Layer: HTTP

COSC4377. Chapter 2: Outline

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

Review of Previous Lecture

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

CMSC 332 Computer Networking Web and FTP

Chapter 2 Application Layer

Web, HTTP and Web Caching

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

Chapter II: Application Layer

Chapter 1 Introduction

HyperText Transfer Protocol

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Computer Networks. Wenzhong Li. Nanjing University

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Applications & Application-Layer Protocols: The Web & HTTP

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

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

Application Protocols and HTTP

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5

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

Foundations of Telematics

CSC 4900 Computer Networks:

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

Applications & Application-Layer Protocols: The Web & HTTP

Application layer. Some network apps. Client-server architecture. Hybrid of client-server and P2P. Pure P2P architecture. Creating a network app

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

Chapter 2: Application Layer. Chapter 2: application layer. outline. Some network apps. Client-server architecture. Application architectures

WWW: the http protocol

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

Chapter 2 Application Layer

SCS3004 Networking Technologies Application Layer Protocols

Chapter 2 Application Layer

CSCD 330 Network Programming Spring 2018

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

CSC 401 Data and Computer Communications Networks

EECS 3214: Computer Network Protocols and Applications

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline

Layered Model. DoD Model. ISO/OSI Model

internet technologies and standards

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline

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

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

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

Protocol Layers, Security Sec: Application Layer: Sec 2.1 Prof Lina Battestilli Fall 2017

Chapter 2 Application Layer

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

Chapter 2. Computer Networking: A Top. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

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

CSCI-1680 WWW Rodrigo Fonseca

CS 3640: Introduction to Networks and Their Applications

Computer Systems and Networks

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

ECE697AA Lecture 2. Today s lecture

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

Chapter 8 Security. Computer Networking: A Top Down Approach

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

Chapter 2: application layer

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

Network Applications Principles of Network Applications

Information Network Systems The application layer. Stephan Sigg

CSCI-1680 WWW Rodrigo Fonseca

Introduc)on to Computer Networks

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

Internet applications

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

Chapter II: Application Layer

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

Computer Networks and Applications

CSC 401 Data and Computer Communications Networks

Homework 2 50 points. CSE422 Computer Networking Spring 2018

Computer Networks and Applications. Introduction(Protocol Layering, Security) & Application Layer (Principles, Web, FTP)

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 4

Application Level Protocols

Wire Shark Lab1. Intro

CS 455/555 Spring 2011 Weigle

CSE 333 Lecture HTTP

Networking Fundamentals

Internet Content Distribution

LAMP, WEB ARCHITECTURE, AND HTTP

WEB TECHNOLOGIES CHAPTER 1

Lecture 12. Application Layer. Application Layer 1

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

Application Layer Protocols

Application Layer IK2218/EP2120. Peter Sjödin, KTH School of ICT

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

Protocols. Application Layer FTP, HTTP, SSH, IMAP. Transport Layer TCP, UDP. Internet Layer IP. Link Layer Ethernet, WiFi

Application Layer Introduction; HTTP; FTP

Networking Fundamentals

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

Transcription:

CSC 401 Data and Computer Communications Networks Application Layer: The Web and HTTP Sec 2.2 Prof Lina Battestilli Fall 2017

Outline Application Layer (ch 2) 2.1 principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP 10

On- Demand! The Web is so popular! Everyone can publish/share info at low cost Hyperlinks, Search engines help us navigate through Photos, videos Forms, JavaScript Platform for YoutTube, Web-Based Email, Mobile Apps, Google Maps, etc REST API 11

Hypertext, HTML, HTTP Hypertext is text which contains links to other texts term coined by Ted Nelson in 1965 http://web.ics.purdue.edu/~gchopra/class/public/pages/webdesign/05_simple.html HTML HyperText Markup Language Tim Berners-Lee at CERN in the 1980s Information on demand! What is HTTP? Let s look at New York Times how many different requests? 12

13 Web and HTTP web page consists of objects object can be HTML file, JPEG image, audio file, web page consists of base HTML-file which includes several referenced objects each object is addressable by a URL, e.g., www.someschool.edu/somedept/pic.gif host name path name

HTTP overview HTTP: hypertext transfer protocol Web s application layer protocol client/server model client: browser that requests, receives, (using HTTP protocol) and displays Web objects server: Web server sends (using HTTP protocol) objects in response to requests PC running Chrome browser server running Apache Web server iphone running Safari browser 14

HTTP overview (continued) uses TCP: client initiates TCP connection (creates socket) to server, usually port 80 server accepts TCP connection from client HTTP messages (applicationlayer 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 cookies an exception aside 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 15

HTTP History Cloud 1996 HTTP v1.0 1999 HTTP v1.1 2009 SPDY 2015 HTTP v2.0 16

HTTP 1.0 vs. HTTP 1.1 Hello Hello Hello Hello Client May I have a picture of a house please Sure, here you go Thanks, bye Apps Client May I have a picture of a house please. Here is the house May I also have a picture of a car. Here is the car Apps Bye Hello Hello Thanks, bye Bye Non-Persistent HTTP 1.0 at most one object sent over TCP connection, ]]connection then closed downloading multiple objects requires multiple connections Persistent HTTP 1.1 multiple objects can be sent over single TCP connection between client, server default mode

Non-persistent HTTP 1.0 suppose user enters URL: www.someschool.edu/somedepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someschool.edu on port 80 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object somedepartment/home.index time (contains text, references to 10 jpeg images) 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, and sends message into its socket 18

Non-persistent HTTP (cont.) 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 4. HTTP server closes TCP connection. time 6. Steps 1-5 repeated for each of 10 jpeg objects Let s look at New York Times how many different requests? 2-19

Non-persistent HTTP: response time RTT (definition): time for a small packet to travel from client to server and back HTTP 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 initiate TCP connection RTT request file RTT file received time time time to transmit file non-persistent HTTP response time = 2RTT+ file transmission time Serial vs. Parallel TCP Connections modern browsers 5-10 parallel 20

Persistent HTTP v1.1 NON-persistent HTTP issues: requires 2 RTTs per object OS overhead for each TCP connection browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP: server leaves TCP connection open after sending response subsequent HTTP messages between same client/server sent over open connection client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects 21

Persistent HTTP: response time HTTP 1.1 Keep Alive initiate TCP connection RTT request file RTT Base file received RTT Base file time to transmit all Inline objects HTTP Pipelining Base file received time time 22

Let s summarize Non-persistent HTTP v 1.0 issues: Connection setup for each request But browsers often open parallel connections Persistent HTTP v.1.1: 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 object Persistent with pipelining: Default in HTTP/1.1 spec Client sends multiple requests As little as one RTT for all the referenced objects Server must handle responses in same order as requests 27

HTTP/2 Why needed? Mobile network latency Reduction in resource availability on mobile clients Residual TCP inefficiencies carried forward with HTTP 1.1 Issues with increasing size and types of content What is it? Derived from the earlier experimental SPDY protocol, originally developed by Google specification was published as RFC 7540 in May 2015 the methods, status codes, and most of the headers are the same. It redefines how data is transferred so it is more efficient 28

HTTP 1.1 vs HTTP 2 Client Hello Hello May I have a picture of a house please. Here is the house May I also have a picture of a car. Here is the car May I also have a picture of a dog. Here is the dog Thanks, bye Bye Apps Client Hello Hello May I have a picture of a house please. And a car And a dog Here is the house Here is the car And a cat Here is the dog Here is the cat Thanks, bye Bye Apps Request pipelining order - prioritization Removes redundant headers Dedicated header compression scheme Transport Layer Security (TLS) optional Requires stronger cryptography

HTTP v2 Adoption https://w3techs.com/technologies/history_overview/site_element/all https://tools.keycdn.com/http2-test 30

31 HTTP request message Two types of HTTP messages: request, response HTTP request message: ASCII (human-readable format) request line (GET, POST, HEAD commands) header lines carriage return, line feed at start of line indicates end of header lines carriage return character line-feed character GET /index.html HTTP/1.1\r\n Host: www-net.cs.umass.edu\r\n User-Agent: Firefox/3.6.10\r\n Accept: text/html,application/xhtml+xml\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n \r\n

HTTP request message: general format method sp URL sp version cr lf header field name value ~ ~ cr lf request line header lines header field name value cr lf cr lf entity body ~~ ~ body 32

Using input from the user POST method: web page often includes form input input is uploaded to server in entity body URL method: uses GET method input is uploaded in URL field of request line: www.somesite.com/animalsearch?monkeys&banana 33

HTTP Method types HTTP/1.0: GET POST HEAD asks server to leave requested object out of response Used for debugging 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 34

35 HTTP response message status line (protocol status code status phrase) header lines data, e.g., requested HTML file HTTP/1.1 200 OK\r\n Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n Server: Apache/2.0.52 (CentOS)\r\n Last-Modified: Tue, 30 Oct 2007 17:00:02 GMT\r\n ETag: "17dc6-a5c-bf716880"\r\n Content-Length: 2652\r\n Keep-Alive: timeout=10, max=100\r\n Connection: Keep-Alive\r\n Content-Type: text/html; charset=iso-8859-1\r\n \r\n data data data data data... * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/

HTTP response status codes 1xx 2xx 3xx 4xx 5xx Hold on Here you go! Go somewhere else! You did something wrong. I did something wrong. 36

Sample HTTP response status codes 200 OK request succeeded, requested object later in this msg 301 Moved Permanently requested object moved, new location specified later in this msg (Location:) 400 Bad Request request msg not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported 37

Trying out HTTP (client side) for yourself 1. Telnet to your favorite Web server: telnet people.engr.ncsu.edu 80 2. type in a GET HTTP request: GET /tbdimitr/teaching.html HTTP/1.1 Host: people.engr.ncsu.edu 3. look at response message sent by HTTP server! opens TCP connection to port 80 (default HTTP server port) at people.engr.ncsu.edu. anything typed is sent by typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server 38

1. Telnet to : Another Example telnet cis.poly.edu 80 2. Type in a GET HTTP request: GET /~ross/ HTTP/1.1 Host: cis.poly.edu 3. look at response message 39

References Some of the slides are identical or derived from 1. Slides for the 7 th edition of the book Kurose & Ross, Computer Networking: A Top-Down Approach, 2. Slides by Jim Kurose for his CSC453 course at Umass 3. Slides from Nick McKeown, CS144 at Stanford University 4. Slides by Lori MacVittie, F5 Networks 5. https://developers.google.com/web/fundamentals/perfor mance/http2 NCSU CSC401 Lina Battestilli