1 / 22

Network Applications

Two or more end systems (Hosts) Client server paradigm Client: initiates contact with server (“speaks first”) typically requests service from server, for Web, client is implemented in browser; for e-mail, in mail reader Server: provides requested service to client

Download Presentation

Network Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Two or more end systems (Hosts) Client server paradigm Client: initiates contact with server (“speaks first”) typically requests service from server, for Web, client is implemented in browser; for e-mail, in mail reader Server: provides requested service to client e.g., Web server sends requested Web page, mail server delivers e-mail Peer to peer paradigm Peers come and leave at any time A peer is both a client and a server Scalability is the advantage Many hybrid peer-to-peer and client-server in real world One or more application Protocols define type of messages syntax of messages: fields and their meaning actions taken user services provided by lower layer protocols Network Applications Mail (smtp), VoIP (sip, rtp) Application Layer

  2. Identifying Applications Q: how does a process “identify” the other process with which it wants to communicate? • IP address of host running other process • 32-bit • Unique ID • “port number” - allows receiving host to determine to which local process the message should be delivered • found in RFC 1700 • RFC http://www.faqs.org/rfc • The combination of IP address and port number is also called “socket” • When a client application talks to a server, we need • client ip address, client port number • source ip address, source port number Socket = (ip address, port #) TCP connection 4-tuple Application Layer

  3. 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: Internet Explorer Firefox Server for Web is called Web server: Apache (public domain) MS Internet Information Server The Web: introduction www.someSchool.edu/someDept/pic.gif Application Layer

  4. 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 http1.0: RFC 1945 (before 1997) http1.1: RFC 2068 (after 1998) The Web: the http protocol http request PC running Explorer http response http request Server running NCSA Web server http response Mac running Navigator Application Layer

  5. http: TCP transport service: 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 The http protocol: more 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 Application Layer

  6. Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode HTTP connections Application Layer

  7. 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 Nonpersistent HTTP (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 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time Application Layer

  8. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects Nonpersistent HTTP (cont.) 4. HTTP server closes TCP connection. time 6.Steps 1-5 repeated for each of 10 jpeg objects Q: how many TCP connections? Q2: If the browser opens one TCP connection at one time, how many round trips altogether? Application Layer

  9. initiate TCP connection RTT request file time to transmit file RTT file received time time Response time modeling Definition of 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 Application Layer

  10. 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 Persistent HTTP How many round trips do we need?Non-persistent, persistent without pipelining, persistent with pipelining Application Layer

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

  12. http request message: general format 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 Application Layer

  13. 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: Uploading form input www.somesite.com/animalsearch?monkeys&banana Application Layer

  14. http message format: response status line (protocol status code status phrase) HTTP/1.0 200 OK Connection: close Date: Thu, 06 Aug 1998 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 ... header lines data, e.g., requested html file Application Layer

  15. 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 http response status codes In first line in server->client response message. A few sample codes: Application Layer

  16. User-Server Identification • Server is stateless • How to identify a user • Authentication • Cookies • Caching • Conditional GET Application Layer

  17. Authentication goal: control access to server documents stateless: client must present authorization in each request authorization: typically name, password authorization: header line in request usual http request msg + Authorization:line usual http request msg + Authorization:line usual http response msg usual http response msg time User-server interaction: authentication server client usual http request msg 401: authorization req. WWW authenticate: Browser caches name & password so that user does not have to repeatedly enter it. Application Layer

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

  19. What cookies can bring: user accounts shopping carts Web portals Advertising Secretly collecting users’ browsing habits What to do? Cookies (continued) Application Layer

  20. Conditional Get • Subsequent cache request • Subsequent server response • First time cache request • First time server response • Cache saves last modification time of the object GET /fruit/kiwi.gif HTTP/1.1 Host: www.exotiquecuisine.com GET /fruit/kiwi.gif HTTP/1.1 Host: www.exotiquecuisine.com If-modified-since: Wed, 2 Jul 2003 09:23:24 HTTP/1.1 200 OK Date: Mon, 7 Jul 2003 15:39:29 Server: Apache/1.3.0 (Unix) Last-Modified: Wed, 2 Jul 2003 09:23:24 Content-Type: image/gif (data data data …) HTTP/1.1 304 Not Modified Date: Mon, 14 Jul 2003 15:39:29 Server: Apache/1.3.0 (Unix) (empty entity body …) Application Layer

  21. Goal: don’t send object if client has up-to-date cached version client: specify date of cached copy in HTTP request If-modified-since: <date> server: response contains no object if cached copy is up-to-date: HTTP/1.0 304 Not Modified HTTP response HTTP/1.0 304 Not Modified Conditional GET: client-side caching server client HTTP request msg If-modified-since: <date> object not modified HTTP request msg If-modified-since: <date> object modified HTTP response HTTP/1.0 200 OK <data> Application Layer

  22. HTTPS • Secure version of HTTP • Procedure: • Client connects, • Systems exchange fresh public keys • Systems agree on a symmetric (fast) protocol (e.g. 3DES) • Server presents certificate • Client accepts or rejects • (Client presents certificate) Application Layer

More Related