Network Applications Drive Network Design ❒ Important to remember that network applications are the reason we care about 3: Application Protocols: building a network infrastructure HTTP and DNS ❒ Applications range from text based command line ones popular in the 1980s (like telnet, ftp, news, chat, etc) to multimedia applications (Web browsers, Last Modified: audio and video streaming, real-time video 2/3/2003 8:13:18 PM conferencing, etc.) 2: Application Layer 2: Application Layer 1 2 Top-down: Internet protocol Credit: What is the Internet used for? CAIDA (1999) stack users network HTTP, SMTP, FTP, TELNET, DNS, … Application TCP, UDP. Transport IP Network Point-to-point links, Physical LANs, radios, ... 2: Application Layer 2: Application Layer 3 4 Protocol stack Applications and application-layer protocols Application: communicating, application distributed processes transport user X English user Y network ❍ running in network hosts in data link physical “user space” SMTP e-mail client e-mail server ❍ exchange messages to implement app ❍ e.g., email, file transfer, the Web TCP TCP server TCP server Application-layer protocols ❍ one “piece” of an app (web application browser do more than speak application IP transport transport HTTP) network IP server IP server network data link data link physical ❍ define messages exchanged physical by apps and actions taken IEEE 802.3 standard ethernet ethernet ❍ user services provided by lower layer protocols driver/card driver/card electric signals 2: Application Layer 2: Application Layer 5 6 1
HTTP Client-server paradigm Typical network app has two application pieces: client and server transport network data link Client: physical request ❒ initiates contact with server (“speaks first”) ❒ typically requests service from server, ❒ for Web, client is implemented reply in browser; for e-mail, in mail reader application transport network Server: data link physical ❒ Running first (always?) ❒ provides requested service to client e.g., Web server sends requested Web page, mail server delivers e-mail 2: Application Layer 2: Application Layer 7 8 The http protocol: more The Web: the http protocol http is “stateless” http: hypertext transfer http: TCP transport protocol service: ❒ server maintains no h t Web’s application layer t p r ❒ e information about q u ❒ client initiates TCP protocol e PC running s http response t past client requests Explorer connection (creates socket) client/server model ❒ to server, port 80 ❍ client: browser that aside requests, receives, ❒ server accepts TCP Protocols that maintain “displays” Web objects t s e connection from client u q “state” are complex! e http response r ❍ server: Web server has Server p t t ❒ http messages (application- h access to storage running ❒ past history (state) must containing a set of Web NCSA Web layer protocol messages) be maintained server documents; sends copies in exchanged between browser ❒ if server/client crashes, response to requests (http client) and Web server their views of “state” may http1.0: RFC 1945 ❒ Mac running (http server) be inconsistent, must be http1.1: RFC 2616 Navigator ❒ ❒ TCP connection closed reconciled ❒ r (e.g. Java applet) 2: Application Layer 2: Application Layer 9 10 Uniform Resource Locator Note: Static vs Dynamic vs (URL) Active Web Pages ❒ Static: Stored in a file and unchanging protocol://authority:port/p/a/th/item_name?query ❒ Dynamic: Formed by server on demand in response to a request ❍ protocol = http ❍ Output from a program (e.g. Common Gateway ❍ authority = server machine Interface (CGI) ) ❍ port = 80 by default ❍ Often use query data sent with URL ❍ /p/a/th/item_name = specifies a file to be returned or possibly a program to be executed ❒ Active: Executed at the client! to produce the file to be returned ❍ Computer program (not just output) that can ❍ query = data to be interpreted by server interact with user (e.g. Java applet) 2: Application Layer 2: Application Layer 11 12 2
http example http example (cont.) Suppose user enters URL 4. http server closes TCP (contains text, connection. www.someSchool.edu/someDepartment/home.index references to 10 5 . http client receives response jpeg images) message containing html file, 1a . http client initiates TCP displays html. Parsing html connection to http server 1b. http server at host file, finds 10 referenced jpeg (process) at objects www.someSchool.edu waiting www.someSchool.edu. Port 80 for TCP connection at port 80. 6. Steps 1-5 repeated for each is default for http server. “accepts” connection, notifying of 10 jpeg objects time client 2. http client sends http request message (containing URL) into 3. http server receives request TCP connection socket message, forms response message containing requested object ( someDepartment/home.index ), sends message into socket time 2: Application Layer 2: Application Layer 13 14 http message format: request http request message: general format ❒ Two types of http messages: request , response ❒ Http request message: ❍ ASCII (human-readable format) request line (GET, POST, GET /somedir/page.html HTTP/1.0 HEAD commands) User-agent: Mozilla/4.0 Accept: text/html, image/gif,image/jpeg header Accept-language:fr lines (extra carriage return, line feed) Carriage return, line feed indicates end of message 2: Application Layer 2: Application Layer 15 16 http message format: response http response status codes In first line in server->client response message. status line (protocol A few sample codes: status code HTTP/1.0 200 OK status phrase) Date: Thu, 06 Aug 1998 12:00:15 GMT 200 OK Server: Apache/1.3.0 (Unix) ❍ request succeeded, requested object later in this message Last-Modified: Mon, 22 Jun 1998 …... header 301 Moved Permanently Content-Length: 6821 lines Content-Type: text/html ❍ requested object moved, new location specified later in this message (Location:) data data data data data ... 400 Bad Request data, e.g., requested ❍ request message not understood by server html file 404 Not Found ❍ requested document not found on this server 505 HTTP Version Not Supported 2: Application Layer 2: Application Layer 17 18 3
Recommend
More recommend