ImageVerifierCode 换一换
格式:PPT , 页数:96 ,大小:1.19MB ,
资源ID:379654      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-379654.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Chapter 2- Application layer.ppt)为本站会员(progressking105)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

Chapter 2- Application layer.ppt

1、2: Application Layer,1,Chapter 2: Application layer,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 file sharing 2.7 Socket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2: Application Layer,2,Chapt

2、er 2: Application Layer,Our goals: conceptual, implementation aspects of network application protocols transport-layer service models client-server paradigm peer-to-peer paradigm,learn about protocols by examining popular application-level protocols HTTP FTP SMTP / POP3 / IMAP DNS programming networ

3、k applications socket API,2: Application Layer,3,Some network apps,E-mail Web Instant messaging Remote login P2P file sharing Multi-user network games Streaming stored video clips,Internet telephone Real-time video conference Massive parallel computing,2: Application Layer,4,Creating a network app,W

4、rite programs that run on different end systems and communicate over a network. e.g., Web: Web server software communicates with browser software little software written for devices in network core network core devices do not run user application code application on end systems allows for rapid app

5、development, propagation,2: Application Layer,5,Chapter 2: Application layer,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 file sharing 2.7 Socket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2:

6、Application Layer,6,Application principles,architectures sockets protocols,2: Application Layer,7,Client-server architecture,server: always-on host permanent IP address server farms for scaling clients: communicate with server may be intermittently connected may have dynamic IP addresses do not comm

7、unicate directly with each other,2: Application Layer,8,Pure P2P architecture,no always-on server arbitrary end systems directly communicate peers are intermittently connected and change IP addresses example: GnutellaHighly scalable but difficult to manage,2: Application Layer,9,Hybrid of client-ser

8、ver and P2P,Skype Internet telephony app Finding address of remote party: centralized server(s) Client-client connection is direct (not through server) Instant messaging Chatting between two users is P2P Presence detection/location centralized: User registers its IP address with central server when

9、it comes online User contacts central server to find IP addresses of buddies,2: Application Layer,10,Processes communicating,Process: program running within a host. within same host, two processes communicate using inter-process communication (defined by OS). processes in different hosts communicate

10、 by exchanging messages,Client process: process that initiates communication Server process: process that waits to be contacted,Note: applications with P2P architectures have client processes & server processes,2: Application Layer,11,Sockets,process sends/receives messages to/from its socket socket

11、 analogous to door sending process shoves message out door sending process relies on transport infrastructure on other side of door which brings message to socket at receiving process,Internet,controlled by OS,controlled by app developer,API: (1) choice of transport protocol; (2) ability to fix a fe

12、w parameters (lots more on this later),2: Application Layer,12,Addressing processes,to receive messages, process must have identifier host device has unique32-bit IP address Q: does IP address of host on which process runs suffice for identifying the process?,2: Application Layer,13,Addressing proce

13、sses,to receive messages, process must have identifier host device has unique32-bit IP address Q: does IP address of host on which process runs suffice for identifying the process? Answer: NO, many processes can be running on same host,identifier includes both IP address and port numbers associated

14、with process on host. Example port numbers: HTTP server: 80 Mail server: 25 to send HTTP message to www.cs.virginia.edu web server: IP address: 128.119.245.12 Port number: 80 more shortly,2: Application Layer,14,App-layer protocol defines,Types of messages exchanged, e.g., request, response Message

15、syntax: what fields in messages & how fields are delineated Message semantics meaning of information in fields Rules for when and how processes send & respond to messages,Public-domain protocols: defined in RFCs allows for interoperability e.g., HTTP, SMTP Proprietary protocols: e.g., KaZaA,2: Appli

16、cation Layer,15,What transport service does an app need?,Data loss some apps (e.g., audio) can tolerate some loss other apps (e.g., file transfer, telnet) require 100% reliable data transfer,Timing some apps (e.g., Internet telephony, interactive games) require low delay to be “effective”,Bandwidth

17、some apps (e.g., multimedia) require minimum amount of bandwidth to be “effective” other apps (“elastic apps”) make use of whatever bandwidth they get,2: Application Layer,16,Transport service requirements of common apps,Applicationfile transfer e-mail Web documents real-time audio/videostored audio

18、/video interactive games instant messaging,Data lossno loss no loss no loss loss-tolerantloss-tolerant loss-tolerant no loss,Bandwidthelastic elastic elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above few kbps up elastic,Time Sensitiveno no no yes, 100s msecyes, few secs yes, 100s msec yes

19、and no,2: Application Layer,17,Internet transport protocols services,TCP service: connection-oriented: setup required between client and server processes reliable transport between sending and receiving process flow control: sender wont overwhelm receiver congestion control: throttle sender when net

20、work overloaded does not provide: timing, minimum bandwidth guarantees,UDP service: unreliable data transfer between sending and receiving process does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee Q: why bother? Why is there a UDP?,2: A

21、pplication Layer,18,Internet apps: application, transport protocols,Applicatione-mail remote terminal access Web file transfer streaming multimediaInternet telephony,Application layer protocolSMTP RFC 2821 Telnet RFC 854 HTTP RFC 2616 FTP RFC 959 proprietary (e.g. RealNetworks) proprietary (e.g., Vo

22、nage,Dialpad),Underlying transport protocolTCP TCP TCP TCP TCP or UDPtypically UDP,2: Application Layer,19,Chapter 2: Application layer,2.1 Principles of network applications app architectures app requirements 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS,2.6 P2P file sharing 2.7 Soc

23、ket programming with TCP 2.8 Socket programming with UDP 2.9 Building a Web server,2: Application Layer,20,Web and HTTP,First some jargon Web page consists of objects Object can be HTML file, JPEG image, Java applet, audio file, Web page consists of base HTML-file which includes several referenced o

24、bjects Each object is addressable by a URL Example URL:,2: Application Layer,21,HTTP overview,HTTP: hypertext transfer protocol Webs application layer protocol client/server model client: browser that requests, receives, “displays” Web objects server: Web server sends objects in response to requests

25、 HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068,PC running Explorer,Server running Apache Web server,Mac running Navigator,HTTP request,HTTP request,HTTP response,HTTP response,2: Application Layer,22,HTTP overview (continued),Uses TCP: client initiates TCP connection (creates socket) to server, port 80 serv

26、er 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,Protocols that maintain “state” are comp

27、lex! past history (state) must be maintained if server/client crashes, their views of “state” may be inconsistent, must be reconciled,aside,2: Application Layer,23,HTTP connections,Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP,Persistent HTTP M

28、ultiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode,2: Application Layer,24,Nonpersistent HTTP,Suppose user enters URL www.someSchool.edu/someDepartment/home.index,1a. HTTP client initiates TCP connection to HTTP serv

29、er (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,1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connec

30、tion, notifying client,3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket,time,(contains text, references to 10 jpeg images),2: Application Layer,25,Nonpersistent HTTP (cont.),5. HTTP client receives response message contain

31、ing 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,2: Application Layer,26,Non-Persistent HTTP: Response time,Definition of RTT: time to send a small packet to travel from clie

32、nt 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,2: Application Layer,27,Persistent HTTP,Nonpersistent HTTP issues: requires 2 RTTs per object OS overhead

33、 for each TCP connection browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP server leaves connection open after sending response subsequent HTTP messages between same client/server sent over open connection,Persistent without pipelining: client issues new reques

34、t 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 object Total Time?,2: Application Layer,28,HTTP request me

35、ssage,two types of HTTP messages: request, response HTTP request message: ASCII (human-readable format),GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed),request line (GET, POST, HEAD commands),hea

36、derlines,Carriage return, line feed indicates end of message,2: Application Layer,29,HTTP request message: general format,2: Application Layer,30,Uploading form input,Post method: Web page often includes form input Input is uploaded to server in entity body,URL method: Uses GET method Input is uploa

37、ded in URL field of request line:, Application Layer,31,Method types,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,2: Application Laye

38、r,32,HTTP response message,HTTP/1.1 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/htmldata data data data data .,status line (protocol status code status phrase),headerlines,data, e.g.

39、, requested HTML file,2: Application Layer,33,HTTP response 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 40

40、4 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:,2: Application Layer,34,Lets look at HTTP in action,telnet example Ethereal example,2: Application Layer,35,HTTP Review,TCP “Stateless” Non-pers

41、istent 44 messages, 22 RTT Persistent 24 messages Non-pipelined 12 RTT Pipelined 3 RTT HTTP Commands (GET, POST, HEAD, etc) HTTP Fields (User-agent, Connection, etc) Telnet as a command-line TCP connection,2: Application Layer,36,Cookies,The need for state: authorization shopping carts recommendatio

42、ns user session state (Web e-mail),Cookies and privacy: cookies permit sites to learn a lot about you you may supply name and e-mail to sites,aside,How to keep “state”: Protocol endpoints: maintain state at sender/receiver over multiple transactions cookies: http messages carry state,2: Application

43、Layer,37,User-server state: cookies,Many major Web sites use cookies Four components: 1) cookie header line of HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on users host, managed by users browser 4) back-end database at Web site,Example: Susan access Intern

44、et always from same PC She visits a specific e-commerce site for first time When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID,2: Application Layer,38,Cookies: keeping “state” (cont.),client,server,usual http request msg,usual http re

45、sponse + Set-cookie: 1678,server creates ID 1678 for user,entry in backend database,2: Application Layer,39,Optimization example,Assumptions average object size = 100,000 bits avg. request rate from institutions browsers to origin servers = 15/sec delay from institutional router to any origin server

46、 and back to router = 2 sec Consequences utilization on LAN = 15% utilization on access link = 100% total delay = Internet delay + access delay + LAN delay= 2 sec + minutes + milliseconds,origin servers,publicInternet,institutional network,10 Mbps LAN,1.5 Mbps access link,institutional cache,2: Appl

47、ication Layer,40,Optimization example (cont),Possible solution increase bandwidth of access link to, say, 10 Mbps Consequences utilization on LAN = 15% utilization on access link = 15% Total delay = Internet delay + access delay + LAN delay= 2 sec + msecs + msecs often a costly upgrade,origin server

48、s,publicInternet,institutional network,10 Mbps LAN,10 Mbps access link,institutional cache,2: Application Layer,41,Optimization example (cont),Install cache suppose hit rate is .4 Consequence 40% requests will be satisfied almost immediately 60% requests satisfied by origin server utilization of acc

49、ess link reduced to 60%, resulting in negligible delays (say 10 msec) total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + .4*milliseconds 1.4 secs,origin servers,publicInternet,institutional network,10 Mbps LAN,1.5 Mbps access link,institutional cache,2: Application Layer,42,Web caches (aka “proxy” server),user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client,

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1