Computer Networks. Wenzhong Li. Nanjing University

Similar documents
Web, HTTP and Web Caching

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

CMSC 332 Computer Networking Web and FTP

Review of Previous Lecture

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

HyperText Transfer Protocol

Chapter 2 Application Layer

EECS 3214: Computer Network Protocols and Applications

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

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

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

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

Chapter 2 Application Layer

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

Foundations of Telematics

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

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

CSC 4900 Computer Networks:

Application Layer: HTTP

Chapter 2 Application Layer

WWW: the http protocol

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

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

Applications & Application-Layer Protocols: The Web & HTTP

Layered Model. DoD Model. ISO/OSI Model

DATA COMMUNICATOIN NETWORKING

CS 43: Computer Networks. HTTP September 10, 2018

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

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

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

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

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

CSCD 330 Network Programming Spring 2018

Chapter 2 Application Layer

COSC4377. Chapter 2: Outline

Chapter 2: Application layer

Lecture 12. Application Layer. Application Layer 1

CSC 257/457 Computer Networks. Fall 2017 MW 4:50 pm 6:05 pm CSB 601

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

Application Protocols and HTTP

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

CSC 401 Data and Computer Communications Networks

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm

Network Applications Principles of Network Applications

Applications & Application-Layer Protocols: The Web & HTTP

SCS3004 Networking Technologies Application Layer Protocols

Review for Internet Introduction

Computer Networks and Applications

Applications Layer Protocols. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

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

Overview Content Delivery Computer Networking Lecture 15: The Web Peter Steenkiste. Fall 2016

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

Content Delivery on the Web: HTTP and CDNs

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

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

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

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

Application Level Protocols

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

Internet Content Distribution

Application Layer Protocols

CSCE 463/612 Networks and Distributed Processing Spring 2018

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

Chapter 2. Application Layer

Application Layer Chapter 2

Information Network Systems The application layer. Stephan Sigg

CMPE 151: Network Administration. Servers

Chapter 2 Application Layer

Chapter 1 Introduction

Application Layer. Goals:

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

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

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

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

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

HTTP and Web Content Delivery

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

Chapter II: Application Layer

Traditional Web Based Systems

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

Computer Network Midterm Explain Internet protocol stack (1% each layer s name, 1% each layer s functions, 10% total)

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

Information Network I: The Application Layer. Doudou Fall Internet Engineering Laboratory Nara Institute of Science and Technique

Chapter 27 WWW and HTTP Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

COSC 2206 Internet Tools. The HTTP Protocol

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

13. Internet Applications 최양희서울대학교컴퓨터공학부

Chapter 2 Application Layer

CS 455/555 Spring 2011 Weigle

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

Introduc)on to Computer Networks

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca

The Application Layer HTTP and FTP

Chapter 2 Application Layer

Multi-threaded Web Server (Assignment 1) Georgios Georgiadis

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

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

CSEN 503 Introduction to Communication Networks

Transcription:

Computer Networks Wenzhong Li Nanjing University 1

Chapter 8. Internet Applications Internet Applications Overview Domain Name Service (DNS) Electronic Mail File Transfer Protocol (FTP) WWW and HTTP Content Distribution Networks (CDNs) 2

Client-Server and P2P Skype Voice-over-IP P2P application Centralized server: finding address of remote party Direct client-client connection Instant messaging Chatting between two users is P2P Centralized service: user presence detection/location User registers its IP address with central server when it comes online User contacts central server to find IP addresses of parties 3

Web and HTTP Web jargons A Web page consists of objects An Object can be HTML file, JPEG image, Java applet, audio file, Web page is composed of base HTML-file which includes several referenced objects Each object is addressable by a URL HTTP (Hypertext Transfer Protocol) Underlying protocol of the WWW (World Wide Web) Transfer objects (plain text, hypertext, audio, images, and other accessible info) over Internet 4

URL Uniform Resource Locator A unique identifier for an object on WWW URL format <protocol>://<host>:<port>/<path>?query_string Protocol: method for transmission or interpretation of the object, e.g. http, ftp, Gopher Host: DNS name or IP address of the host where object resides Path: pathname of the file that contains the object Query_string: name/value pairs sent to app on the server An example http://www.nju.edu.cn:8080/somedir/page.htm 5

HTTP Overview Web's application layer protocol Uses TCP connections Client/Server model Client: browser that requests, receives, displays Web objects PC running Explorer Server: Web server sends objects in response to requests HTTP versions Server running Apache Web server HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068 Mac running Navigator 6

HTTP Procedure Based on TCP connection Client initiates TCP connection (creates socket) to server, use port 80 Server accepts TCP connection from client HTTP msgs exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed by server after that HTTP is stateless Each transaction (connection) treated independently Server maintains no information about past client requests 7

HTTP Connections Nonpersistent HTTP At most one object is sent over a TCP connection By Http 1.0 Persistent HTTP Multiple objects can be sent over single TCP connection between client and server HTTP 1.1 uses persistent connections in default mode 8

Nonpersistent HTTP When user enters URL http://www.someschool.edu/somedepartment/home.index Http Client (Browser) 1a. C initiates TCP connection to S at www.someschool.edu on port 80 2. C sends HTTP request msg indicating that C wants object somedepartment/home.index 5. C receives response msg, parses and displays html file, finds 10 referenced jpeg objects 6. Steps 1~5 repeated for each of 10 jpeg objects Http Server 1b. S at www.someschool.edu listening at port 80, accepts connection, notifying C 3. S receives request msg, forms response msg containing requested object, and sends back 4. S closes TCP connection time 9

Persistent HTTP (1) Nonpersistent HTTP Requires one transaction per object Browsers often open parallel TCP connections to fetch referenced objects OS must work and allocate host resources for each TCP connection Persistent HTTP Server leaves connection open after sending response Subsequent HTTP messages between same client / server are sent over connection 10

Persistent HTTP (2) Persistent without pipelining Client issues new request only when previous response has been received One RTT for each referenced object Persistent with pipelining Client sends requests as soon as it encounters a referenced object As little as one RTT for all the referenced objects Default in HTTP 1.1 11

HTTP Request Message 2 types of HTTP messages: Request, Response Message in 7-bit ASCII (human-readable format) request line (GET, POST, HEAD commands) CR, LF indicates end of message header lines GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra CR or LF) 12

Request Message in Detail 13

2 Common Request Methods Post method Web page often includes form input Input is uploaded to server in entity body using post Get method Retrieve information on Server by URL, and display Other common methods Head (retrieve only headers) By HTTP 1.1: Put, Delete 14

HTTP Response Message Message also in 7-bit ASCII (human-readable format) status line (code + phase) data, e.g. requested HTML file header lines HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 2003 12: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 15

Response Message in Detail Status-Line HTTP-Version <SP> Status-Code <SP> Reason-Phrase <CRLF> 16

Typical HTTP 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 17

Entity Body Arbitrary sequence of octets specifying the resource HTTP transfers any type of data Text, Binary data Audio, Images, Video Interpretation of data determined by header fields Content-Type: text/html; charset = ISO-8859-4 Content-Encoding: gzip Transfer-Encoding: chunked 18

User-Server Interaction: Authorization Authorization: control access to server content Authorization header line in each request Authorization credentials: typically name, password client usual http request msg 401: authorization req. WWW authenticate usual http request msg Authorization: <cred> usual http response msg server Stateless: client must present authorization in each request usual http request msg Authorization: <cred> usual http response msg time 19

Cookies: Keeping State Many major Web sites use cookies Keep track of client s status on server Major components Cookie header line in the HTTP request / response message Cookie file kept on client s host and managed by client s browser Back-end database at Web server site 20

A Cookies Example Client Server ebay 8734 cookie file ebay 8734 amazon 1678 one week later: ebay 8734 amazon 1678 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 Amazon server creates ID 1678 for user create entry cookiespecific action cookiespectific action access access backend database 21

Application of Cookies What cookies can bring Authorization Shopping carts Recommendations User session state (Web Email) Cookies and privacy aside Cookies permit servers to learn a lot about user User may supply name and Email to servers Search engines may use cookies to obtain info across sites Hacked browser may do bad things with cookies 22

Proxy Server An intermediary app that Represents the client to issue request, and Represents the server to give response Different types 23

Web Caches User sets browser: Web accesses via cache Browser sends all HTTP requests to cache on proxy server client Proxy server origin server Object in cache: cache returns object Or cache requests object from origin server, then returns object to client client 24

Caching Example Institutional cache Satisfy internal client request without involving origin server Considerations Smaller response time Decrease traffic to distant servers Load balancing 25

Caching Example One trip delay = Internet delay + access delay + LAN delay Suppose Internet delay = 2 sec LAN delay = 2 msec Access delay = 10 msec Suppose hit rate is 0.4 (40%) Access without cache: (2000+2+10) 2 = 4024 msec = 4.02 sec Access with cache: (2+10 + 0.6 2000) 2 = 2424 msec = 2.4 sec 26

Conditional GET Goal proxy server Don t send object if proxy has up-to-date cached version Client (Proxy) Specify date of cached copy in HTTP request Server Response contains no object if cached copy is up-to-date HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object not modified object modified 27

Content Distribution Networks (CDNs) Challenge Stream large files (e.g. video) from single origin server in real time Protect origin server from DDOS attacks Origin server in North America CDN distribution node Solution Replicate content at hundreds of servers throughout Internet CDN distribution node coordinate the content distribution Placing content close to user CDN server in S. America CDN server in Europe CDN server in Asia 28

Content Replication Content provider (origin server) is CDN customer CDN replicates customers content in CDN servers When provider updates content, CDN updates its servers Use authoritative DNS server to redirect requests 29

Supporting Techniques DNS One name maps onto many addresses Routing Content-based routing (to nearest CDN server) URL Rewriting Replaces http://www.sina.com/sports/tennis.mov with http://www.cdn.com/www.sina.com/sports/tennis.mov Redirection strategy Load balancing, network delay, cache/content locality 30

CDN Operation CDN Server CDN authoritative Server 1 URL rewriting get authoritative server 3 2 1 1. Get near CDN server IP address 2. Warm up CDN cache Client 1 Origin Server 3. Retrieve pages/media from CDN Server 31

Redirection CDN creates a map, indicating distances from leaf ISPs and CDN servers When query arrives at authoritative DNS server Server determines ISP from which query originates Uses map to determine best CDN server CDN servers create an application-layer overlay network 32

Summary Conceptual, implementation aspects of network application protocols Client-Server vs. Peer-to-Peer Data presentation formatting Examining popular application-level protocols DNS, SNMP / MIB HTTP, FTP, SMTP / POP3 / MIME Content distribution networks (CDNs) 33