1 Computer Networks Application layer (Part 2). 2 Application layer protocols Last class –Application layer functions –Application protocols DNS ftp This.

Slides:



Advertisements
Similar presentations
1 Electronic Mail u Three major components: u user agents u mail servers u simple mail transfer protocol: SMTP u User Agent u a.k.a. “mail reader” u composing,
Advertisements

HyperText Transfer Protocol (HTTP)
Application Layer-11 CSE401N: Computer Networks Lecture-4 Application Layer Overview HTTP.
Chapter 2: Application Layer
Layer Aplikasi Risanuri Hidayat. Applications and application-layer protocols Application: communicating, distributed processes –e.g., , Web, P2P.
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Electronic Mail and 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.
2: Application Layer1 Chapter 2: Application Layer Chapter goals: r conceptual + implementation aspects of network application protocols m client server.
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.
Esimerkki: Sähköposti. Lappeenranta University of Technology / JP, PH, AH Electronic Mail Three major components: user agents mail servers simple mail.
Simple Mail Transfer Protocol
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Mail Server Fitri Setyorini. Content SMTP POP3 How mail server works IMAP.
Electronic Mail Three major components: SMTP user agents mail servers
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Trying out HTTP (client side) for yourself
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Lecture51 Administrative Things r Grader: Yona Raekow Office hours: Wed. 1pm-3pm or Th. 11am-1pm r Homeworks.
CSE401N: Computer Networks Lecture-5 Electronic Mail S. M. Hasibul Haque Lecturer Dept. of CSE, BUET.
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.
Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin.
Review: –How do we address “a network end-point”? –What services are provided by the Internet? –What is the network logical topology observed by a network.
Application Layer Protocols Simple Mail Transfer Protocol.
DNS,SMTP,MIME.
2: Application Layer1 Chapter 2: Application Layer Chapter goals: r conceptual + implementation aspects of network application protocols m client server.
2: Application Layer1 Chapter 2: Application Layer Chapter goals: r conceptual + implementation aspects of network application protocols m client server.
2: Application Layer1 Application Layer Chapter goals: r conceptual + implementation aspects of network application protocols m client server paradigm.
2: Application Layer1 Reminder r Homework 1 for Wednesday: m Problems #3-5,11,16,18-20 m Half of the problems will be graded r Feel free to send me .
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.
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,…
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,
File Transfer Protocol (FTP)
1 Application Layer Goals: r conceptual + implementation aspects of network application protocols m client server paradigm m service models r learn about.
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.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
Application layer (Part 2)
CSE 524: Lecture 4 Application layer protocols. Administrative ● Reading assignment Chapter 2 ● Mid-term exam may be delayed to 11/2/2004 – Mostly on.
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
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.
Slides based on Carey Williamson’s: FTP & SMTP1 File Transfer Protocol (FTP) r FTP client contacts FTP server at port 21, specifying TCP as transport protocol.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
World Wide Web r Most Web pages consist of: m base HTML page, and m several referenced objects addressed by a URL r URL has two components: host name and.
COMP 431 Internet Services & Protocols
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.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Lecture 5 Internet Core: Protocol layers. Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP 
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Internet transport protocols services
Chapter 2: Application layer
Chapter 2: Application Layer
Chapter 2 Application Layer
Chapter 2: Application Layer
CSCI-351 Data communication and Networks
Presentation transcript:

1 Computer Networks Application layer (Part 2)

2 Application layer protocols Last class –Application layer functions –Application protocols DNS ftp This class –More application protocols http smtp

3 AL: WWW basics Web page: –consists of “objects” –addressed by a URL Most Web pages consist of: –base HTML page, and –several referenced objects. URL has two components: host name and path name: User agent for Web is called a browser: –MS Internet Explorer –Netscape Communicator Server for Web is called Web server: –Apache (public domain) –MS Internet Information Server

4 AL: HTTP basics 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 – HTTP state management (cookies): RFC 2109 – PC running Explorer Server running NCSA Web server Mac running Navigator http request http response

5 AL: http http: TCP transport service: client initiates bi-directional TCP connection (via socket) to server, port 80 server accepts TCP connection http protocol messages exchanged between client and server –Requests/responses encoded in text –Client sends request to server, followed by response from server to client –How to mark end of message? –Size of message  Content-Length Must know size of transfer in advance –Server closes connection TCP connection closed (only server can do this) 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

6 AL: http example Suppose user enters URL 1a. http client initiates TCP connection to http server (process) at Port 80 is default for http server. 2. http client sends http request message (containing URL) into TCP connection socket 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 ( someDepartment/home.index ), sends message into socket time (contains text, references to 10 jpeg images)

7 AL: http example (cont.) 5. http client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects 4. http server closes TCP connection. time

8 AL: http message format: request two types of http messages: request, response http request message: –ASCII (human-readable format) GET /somedir/page.html HTTP/1.0 User-agent: Mozilla/4.0 Accept: text/html, image/gif,image/jpeg Accept-language:fr (extra carriage return, line feed) request line (GET, POST, HEAD commands) header lines Carriage return, line feed indicates end of message

9 AL: http request message: general format

10 AL: http request Request line –Method GET – return object sepecified by URI HEAD – return headers only of GET response POST – send data to the server (forms, etc.) Other methods: OPTIONS, PUT, DELETE, TRACE, CONNECT –URI E.g. with a proxyhttp:// E.g. /index.html if no proxy –HTTP version

11 AL: http request Header lines (HTTP request headers) –Authorization Authentication info –Accept Acceptable document types, encodings, languages, character sets –From User (when privacy is disabled) –If-Modified-Since For use with caching –Referer URL which caused this page to be requested –User-Agent Client software –Host For multiple web sites hosted on same server –Connection Keep connection alive for subsequent request or close connection

12 AL: http request Blank-line –Separate request headers from POST information –End of request Body –If POST, send POST information

13 AL: http request example GET / HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: Connection: Keep-Alive

14 AL: http message format: response HTTP/ OK 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

15 AL: http response Status-line –HTTP version –3 digit response code 1XX – informational 2XX – success 3XX – redirection 4XX – client error 5XX – server error –Reason phrase

16 AL: http response 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:

17 AL: http response Header lines –Location redirection –Server server software –WWW-Authenticate request for authentication –Allow list of methods supported (get, head, etc) –Content-Encoding x-gzip –Content-Length –Content-Type –Expires –Last-Modified –ETag

18 AL: http response Blank-line –Separate headers from data Body –Data being returned to client

19 AL: http response example HTTP/ OK Date: Tue, 27 Mar :49:38 GMT Server: Apache/ (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 :54:18 GMT ETag: "7a11f-10ed-3a75ae4a" Accept-Ranges: bytes Content-Length: 4333 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html …..

20 AL: 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 in sent to port 80 at telnet Type in a GET http request: GET /~wuchang/index.html HTTP/1.0 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!

21 AL: More HTTP examples

22 AL: Some HTTP headers by function Authentication –Client Authorization, Proxy-Authorization –Server WWW-authenticate, Proxy-Authenticate Caching –General Cache-control, Pragma –Client If-Modified-Since, If-Unmodified-Since, If-Match –Server Last-Modified, Expires, ETag, Age

23 AL: Some HTTP headers by function User, server tracking –Client Cookie, Referer, From, User-agent –Server Set-cookie, Server

24 AL: User-server interaction: authentication Authentication goal: control access to server documents stateless: client must present authorization in each request authorization: typically name, password –authorization: header line in request –if no authorization presented, server refuses access, sends WWW authenticate: header line in response ub-doc/home.jsphttp:// ub-doc/home.jsp client server usual http request msg 401: authorization req. WWW authenticate: usual http request msg + Authorization:line usual http response msg usual http request msg + Authorization:line usual http response msg time Browser caches name & password so that user does not have to repeatedly enter it.

25 AL: User-server interaction: cookies server sends “cookie” to client in response mst Set-cookie: client presents cookie in later requests cookie: server matches presented- cookie with server-stored info –authentication –remembering user preferences, previous choices, shopping carts client server usual http request msg usual http response + Set-cookie: # usual http request msg cookie: # usual http response msg usual http request msg cookie: # usual http response msg cookie- spectific action cookie- spectific action

26 AL: User-server interaction: caching Goal: don’t send object if client has up-to-date stored (cached) version client: specify date of cached copy in http request If-modified-since: server: response contains no object if cached copy up-to-date: HTTP/ Not Modified client server http request msg If-modified-since: http response HTTP/ Not Modified object not modified http request msg If-modified-since: http response HTTP/ OK … object modified

27 AL: HTTP caching Additional caching methods –If-Modified-Since requests to check HTTP 0.9/1.0 used just date –ETag and If-Match HTTP 1.1 has file signature as well When/how often should the original be checked for changes? –Check every time? –Check each session? Day? Etc? –Use Expires header If no Expires, often use Last-Modified as estimate

28 AL: Example Cache Check Request GET / HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate If-Modified-Since: Mon, 29 Jan :54:18 GMT If-None-Match: "7a11f-10ed-3a75ae4a" User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Host: Connection: Keep-Alive

29 AL: Example Cache Check Response HTTP/ Not Modified Date: Tue, 27 Mar :50:51 GMT Server: Apache/ (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 Connection: Keep-Alive Keep-Alive: timeout=15, max=100 ETag: "7a11f-10ed-3a75ae4a"

30 AL: Web Caches (proxy server) user sets browser: Web accesses via web cache client sends all http requests to web cache –if object at web cache, web cache immediately returns object in http response –else requests object from origin server, then returns http response to client Goal: satisfy client request without involving origin server client Proxy server client http request http response http request http response http request http response origin server origin server

31 AL: Why Web Caching? Assume: cache is “close” to client (e.g., in same network) smaller response time: cache “closer” to client decrease traffic to distant servers –link out of institutional/local ISP network often bottleneck Further info on web caching – – –ICP origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps access link institutional cache

32 AL: Non-persistent and persistent connections Non-persistent HTTP/1.0 server parses request, responds, and closes TCP connection Each object transfer suffers from slow start Persistent default for HTTP/1.1 on same TCP connection: server, parses request, responds, parses new request,.. Client sends requests for all referenced objects as soon as it receives base HTML. But most 1.0 browsers use parallel TCP connections.

33 AL: HTTP 0.9/1.0 One request/response per TCP connection –Simple to implement Disadvantages –Multiple connection setups  three-way handshake each time Several extra round trips added to transfer (if done serially) –Multiple slow starts

34 AL: Non-persistent connections Short transfers are hard on TCP –Stuck in slow start –Loss recovery is poor when windows are small Lots of extra connections –Increases server state/processing Server also forced to keep TIME_WAIT connection state –Why must server keep these? –Tends to be an order of magnitude greater than #of active connections, why?

35 AL: Single Transfer Example Client Server SYN ACK DAT FIN ACK 0 RTT 1 RTT 2 RTT 3 RTT 4 RTT Server reads from disk FIN Server reads from disk Client opens TCP connection Client sends HTTP request for HTML Client parses HTML Client opens TCP connection Client sends HTTP request for image Image begins to arrive

36 AL: Netscape Solution Use multiple concurrent connections to improve response time –Different parts of Web page arrive independently –Can grab more of the network bandwidth than other users Doesn’t necessarily improve response time –TCP loss recovery ends up being timeout dominated because windows are small

37 AL: Persistent Connection Solution Multiplex multiple transfers onto one TCP connection –Serialize transfers  client makes next request only after previous response Benefits greatest for small objects –Up to 2x improvement in response time Server resource utilization reduced due to fewer connection establishments and fewer active connections TCP behavior improved –Longer connections help adaptation to available bandwidth –Larger congestion window improves loss recovery HTTP/1.1 vs. HTTP/1.0 example –Multiple requests to

38 AL: Persistent Connection Example Client Server ACK DAT ACK 0 RTT 1 RTT 2 RTT Server reads from disk Client sends HTTP request for HTML Client parses HTML Client sends HTTP request for image Image begins to arrive DAT Server reads from disk DAT

39 AL: Persistent Connection Solution Pipelining requests –Getall – request HTML document and all embeds Requires server to parse HTML files Embeds returned serially Doesn’t consider client cached documents –Getlist – request a set of documents Implemented as a simple set of GETs Problems with pipelined serialized requests –Stall in one object prevents delivery of others –Much of the useful information in first few bytes (layout info) –Multiple connections allow incremental rendering of images as they come in –Need application-level demux to emulate multiple connections HTTP-NG, HTTP/2.0, HTTP range requests –Application specific solution to transport protocol problems –SCTP

40 AL: Electronic Mail Three major components: user agents mail servers simple mail transfer protocol: smtp User Agent a.k.a. “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Netscape Messenger outgoing, incoming messages stored on server user mailbox outgoing message queue mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

41 AL: Electronic Mail: mail servers Mail Servers mailbox contains incoming messages (yet to be read) for user message queue of outgoing (to be sent) mail messages smtp protocol between mail servers to send messages –client: sending mail server –“server”: receiving mail server mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

42 AL: Electronic Mail: smtp [RFC 821] uses tcp to reliably transfer msg from client to server, port 25 direct transfer: sending server to receiving server three phases of transfer –handshaking (greeting) –transfer of messages –closure command/response interaction –commands: ASCII text –response: status code and phrase messages must be in 7-bit ASCII

43 AL: Sample smtp interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 Sender ok C: RCPT TO: S: 250 Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C:. S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection

44 AL: try smtp interaction for yourself: telnet servername 25 see 220 reply from server enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send without using client (reader)

45 AL: smtp: final words smtp uses persistent connections smtp requires that message (header & body) be in 7-bit ascii certain character strings are not permitted in message (e.g., CRLF.CRLF ). Thus message has to be encoded (usually into either base-64 or quoted printable) smtp server uses CRLF.CRLF to determine end of message Comparison with http http: pull push both have ASCII command/response interaction, status codes http: each object is encapsulated in its own response message smtp: multiple objects message sent in a multipart message

46 AL: Mail message format smtp: protocol for exchanging msgs RFC 822: standard for text message format: header lines, e.g., –To: –From: –Subject: different from smtp commands! body –the “message”, ASCII characters only header body blank line

47 AL: Message format: multimedia extensions MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type From: To: Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data base64 encoded data multimedia data type, subtype, parameter declaration method used to encode data MIME version encoded data

48 AL: MIME types Content-Type: type/subtype; parameters Text example subtypes: plain, html Image example subtypes: jpeg, gif Audio exampe subtypes: basic (8-bit mu-law encoded), 32kadpcm (32 kbps coding) Video example subtypes: mpeg, quicktime Application other data that must be processed by reader before “viewable” example subtypes: msword, octet-stream

49 AL: Multipart Type From: To: Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Dear Bob, Please find a picture of a crepe Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data base64 encoded data

50 AL: Mail access protocols SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server –POP: Post Office Protocol [RFC 1939] authorization (agent server) and download –IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server –HTTP: Hotmail, Yahoo! Mail, etc. user agent sender’s mail server user agent SMTP POP3 or IMAP receiver’s mail server

51 AL: POP3 protocol authorization phase client commands: –user: declare username –pass: password server responses –+OK –-ERR transaction phase, client: list: list message numbers top: get head of message retr: retrieve message by number dele: delete quit C: list S: S: S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on