计算机网络课件:Chapter2-2.ppt

上传人(卖家):罗嗣辉 文档编号:2136293 上传时间:2022-03-01 格式:PPT 页数:105 大小:3.21MB
下载 相关 举报
计算机网络课件:Chapter2-2.ppt_第1页
第1页 / 共105页
计算机网络课件:Chapter2-2.ppt_第2页
第2页 / 共105页
计算机网络课件:Chapter2-2.ppt_第3页
第3页 / 共105页
计算机网络课件:Chapter2-2.ppt_第4页
第4页 / 共105页
计算机网络课件:Chapter2-2.ppt_第5页
第5页 / 共105页
点击查看更多>>
资源描述

1、2: Application Layer1Chapter 2: Application LayerOur goals: rconceptual, implementation aspects of network application protocolsvtransport-layer service modelsvclient-server paradigmvpeer-to-peer paradigmrlearn about protocols by examining popular application-level protocolsvHTTPvFTPvSMTP / POP3 / I

2、MAPvDNSrprogramming network applicationsvsocket API2: Application Layer2Some network appsre-mailrwebrinstant messagingrremote loginrP2P file sharingrmulti-user network gamesrstreaming stored video clipsrsocial networksrvoice over IPrreal-time video conferencingrgrid computing2: Application Layer3Cre

3、ating a network appwrite programs thatvrun on (different) end systemsvcommunicate over networkve.g., web server software communicates with browser softwareNo need to write software for network-core devicesvNetwork-core devices do not run user applications vapplications on end systems allows for rapi

4、d app development, propagationapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysical2: Application Layer4Application architecturesrClient-servervIncluding data centers / cloud computingrPeer-to-peer (P2P)rHybrid of client-

5、server and P2P2: Application Layer5Client-server architectureserver: valways-on hostvpermanent IP addressvserver farms for scalingclients:vcommunicate with servervmay be intermittently connectedvmay have dynamic IP addressesclient/serverGoogle Data CentersrEstimated cost of data center: $600MrGoogle

6、 spent $2.4B in 2007 on new data centersrEach data center uses 50-100 megawatts of power2: Application Layer7Pure P2P architecturerno always-on serverrarbitrary end systems directly communicaterpeers are intermittently connected and change IP addressesHighly scalable but difficult to managepeer-peer

7、2: Application Layer8Hybrid of client-server and P2PSkypevvoice-over-IP P2P applicationvcentralized server: finding address of remote party: vclient-client connection: direct (not through server) Instant messagingvchatting between two users is P2Pvcentralized service: client presence detection/locat

8、ion user registers its IP address with central server when it comes online user contacts central server to find IP addresses of buddies2: Application Layer9Processes communicatingProcess: program running within a host.rwithin same host, two processes communicate using inter-process communication (de

9、fined by OS).rprocesses in different hosts communicate by exchanging messagesClient process: process that initiates communicationServer process: process that waits to be contacted2: Application Layer10Socketsrprocess sends/receives messages to/from its socketrsocket analogous to doorvsending process

10、 shoves message out doorvsending process relies on transport infrastructure on other side of door which brings message to socket at receiving processprocessTCP withbuffers,variablessockethost orserverprocessTCP withbuffers,variablessockethost orserverInternetcontrolledby OScontrolled byapp developer

11、rAPI: (1) choice of transport protocol; (2) ability to fix a few parameters 2: Application Layer11Addressing processesrto receive messages, process must have identifierrhost device has unique 32-bit IP addressrExercise: use ipconfig from command prompt to get your IP address (Windows)rQ: does IP add

12、ress of host on which process runs suffice for identifying the process?vA: No, many processes can be running on samerIdentifier includes both IP address and port numbers associated with process on host.rExample port numbers:vHTTP server: 80vMail server: 252: Application Layer12App-layer protocol def

13、inesrTypes of messages exchanged, ve.g., request, response rMessage syntax:vwhat fields in messages & how fields are delineatedrMessage semantics vmeaning of information in fieldsrRules for when and how processes send & respond to messagesPublic-domain protocols:rdefined in RFCsrallows for interoper

14、abilityre.g., HTTP, SMTP, BitTorrentProprietary protocols:re.g., Skype, ppstream2: Application Layer13What transport service does an app need?Data lossrsome apps (e.g., audio) can tolerate some lossrother apps (e.g., file transfer, telnet) require 100% reliable data transfer Timingrsome apps (e.g.,

15、Internet telephony, interactive games) require low delay to be “effective”Throughputrsome apps (e.g., multimedia) require minimum amount of throughput to be “effective”rAvailable bandwidthrother apps (“elastic apps”) make use of whatever throughput they get SecurityrEncryption, data integrity, 2: Ap

16、plication Layer14Transport service requirements of common appsApplicationfile transfere-mailWeb documentsreal-time audio/videostored audio/videointeractive gamesinstant messagingData lossno lossno lossno lossloss-tolerantloss-tolerantloss-tolerantno lossThroughputelasticelasticelasticaudio: 5kbps-1M

17、bpsvideo:10kbps-5Mbpssame as above few kbps upelasticTime Sensitivenononoyes, 100s msecyes, few secsyes, 100s msecyes and no2: Application Layer15Internet transport protocols servicesTCP service:rconnection-oriented: setup required between client and server processesrreliable transport between sendi

18、ng and receiving processrflow control: sender wont overwhelm receiver rcongestion control: throttle sender when network overloadedrdoes not provide: timing, minimum throughput guarantees, securityUDP service:runreliable data transfer between sending and receiving processrdoes not provide: connection

19、 setup, reliability, flow control, congestion control, timing, throughput guarantee, or security Q: why bother? Why is there a UDP?2: Application Layer16Internet apps: application, transport protocolsApplicatione-mailremote terminal accessWeb file transferstreaming multimediaInternet telephonyApplic

20、ationlayer protocolSMTP RFC 2821Telnet RFC 854HTTP RFC 2616FTP RFC 959HTTP (eg Youtube), RTP RFC 1889SIP, RTP, proprietary(e.g., Skype)Underlyingtransport protocolTCPTCPTCPTCPTCP or UDPtypically UDP2: Application Layer17Web and HTTPFirst some jargonrWeb page consists of objectsvObject can be HTML fi

21、le, JPEG image, Java applet, audio file,vHomepage rWeb page consists of base HTML-file which includes several referenced objectsvHypertext markup languagerEach object is addressable by a URL,Example URL:www.someschool.edu/someDept/pic.gifhost namepath name2: Application Layer18HTTP overviewHTTP: hyp

22、ertext transfer protocolrWebs application layer protocolvUsed for communication rclient/server modelvclient: browser that requests, receives, “displays” Web objectsvserver: Web server sends objects in response to requestsPC runningExplorerServer runningApache WebserverMac runningNavigatorHTTP reques

23、tHTTP requestHTTP responseHTTP response2: Application Layer19HTTP overview (continued)Uses TCP:rclient initiates TCP connection (creates socket) to server, port 80rserver accepts TCP connection from clientrHTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) an

24、d Web server (HTTP server)rTCP connection closedHTTP is “stateless”rserver maintains no information about past client requestsProtocols that maintain “state” are complex!rpast history (state) must be maintainedrif server/client crashes, their views of “state” may be inconsistent, must be reconcileda

25、side2: Application Layer20HTTP connectionsNonpersistent HTTPrAt most one object is sent over a TCP connection.Persistent HTTPrMultiple objects can be sent over single TCP connection between client and server.2: Application Layer21Nonpersistent HTTPSuppose user enters URL www.someSchool.edu/someDepar

26、tment/home.index1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 802. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index1b. HTTP server at host www.som

27、eSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client3. HTTP server receives request message, forms response message containing requested object, and sends message into its sockettime(contains text, references to 10 jpeg images)2: Application Layer22Nonpersistent

28、HTTP (cont.)5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects6. Steps 1-5 repeated for each of 10 jpeg objects4. HTTP server closes TCP connection. time2: Application Layer23Non-Persistent HTTP: Response timeDefinition o

29、f RTT: time for a small packet to travel from client to server and back.vround trip timeResponse time:rone RTT to initiate TCP connectionrone RTT for HTTP request and first few bytes of HTTP response to returnrfile transmission timetotal = 2RTT+transmit timetime to transmit fileinitiate TCPconnectio

30、nRTTrequestfileRTTfilereceivedtimetime2: Application Layer24Persistent HTTPNonpersistent HTTP issues:rrequires 2 RTTs per objectrOS overhead for each TCP connectionrbrowsers often open parallel TCP connections to fetch referenced objectsPersistent HTTPrserver leaves connection open after sending res

31、ponsersubsequent HTTP messages between same client/server sent over open connectionrclient sends requests as soon as it encounters a referenced objectras little as one RTT for all the referenced objects2: Application Layer25HTTP request messagertwo types of HTTP messages: request, responserHTTP requ

32、est message:vASCII (human-readable format)GET /somedir/page.html HTTP/1.1Host: www.someschool.edu User-agent: Mozilla/4.0Connection: close Accept-language:fr (extra carriage return, line feed) request line(GET, POST, HEAD,PUT,DELETE)header linesCarriage return, line feed indicates end of message2: A

33、pplication Layer26HTTP request message: general format2: Application Layer27HTTP response messageHTTP/1.1 200 OK Connection closeDate: 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 . s

34、tatus line(protocolstatus codestatus phrase)header linesdata, e.g., requestedHTML file2: Application Layer28HTTP response status codes200 OKvrequest succeeded, requested object later in this message301 Moved Permanentlyvrequested object moved, new location specified later in this message (Location:)

35、400 Bad Requestvrequest message not understood by server404 Not Foundvrequested document not found on this server505 HTTP Version Not SupportedIn first line in server-client response message.A few sample codes:2: Application Layer29User-server state: cookiesMany major Web sites use cookiesFour compo

36、nents:1) cookie header line of HTTP response message2) cookie header line in HTTP request message3) cookie file kept on users host, managed by users browser4) back-end database at Web siteExample:rSusan always access Internet from PCrvisits specific e-commerce site for first timerwhen initial HTTP r

37、equests arrives at site, site creates: vunique IDventry in backend database for ID2: Application Layer30Cookies: keeping “state” (cont.)clientserverusual http response msgusual http response msgcookie fileone week later:usual http request msgcookie: 1678cookie-specificactionaccessebay 8734usual http

38、 request msgAmazon servercreates ID1678 for usercreate entryusual http response Set-cookie: 1678 ebay 8734amazon 1678usual http request msgcookie: 1678cookie-spectificactionaccessebay 8734amazon 1678backenddatabaseWeb CachesrProxy CacherClient CacherDistributed CachesrServer Caches:clusterWhy Web ca

39、ching?rreduce response time for client requestrreduce traffic on an institutions access link.2: Application Layer32Web caches (proxy server)ruser sets browser: Web accesses via cacherbrowser sends all HTTP requests to cachevobject in cache: cache returns object velse cache requests object from origi

40、n server, then returns object to clientGoal: satisfy client request without involving origin serverclientProxyserverclientHTTP requestHTTP responseHTTP requestHTTP requestorigin serverorigin serverHTTP responseHTTP response2: Application Layer33Caching example Assumptionsraverage object size = 1Mbit

41、sravg. request rate from institutions browsers to origin servers = 15/secrdelay from internet router to any origin server and back to router = 2 secConsequencesrutilization on LAN = 15%rutilization on access link = 100%rtotal delay = Internet delay + link delay + LAN delay = 2 sec + 2/15 + 2/100=2.1

42、5 soriginserverspublic Internetinstitutionalnetwork100 Mbps LAN15 Mbps access linkinstitutionalcache2s2: Application Layer34Caching example (cont)possible solutionrincrease bandwidth of access link to, say, 100 Mbpsconsequencerutilization on LAN = 15%rutilization on access link = 15%rTotal delay = I

43、nternet delay + link delay + LAN delay = 2 sec + 2/100 + 2/100=2.042.15roften a costly upgradeoriginserverspublic Internetinstitutionalnetwork100 Mbps LAN100 Mbps access linkinstitutionalcache2: Application Layer35Caching example (cont)possible solution: install cachersuppose hit rate is 0.4conseque

44、ncer40% requests will be satisfied almost immediatelyr60% requests satisfied by origin serverrutilization of access link reduced to 60%, resulting in negligible delays (say 10 msec)rtotal avg delay = Internet delay + link delay + LAN delay = .6*(2+2/15+2/100) + .4*2/100 = 1.37 2.15originserverspubli

45、c Internetinstitutionalnetwork100 Mbps LAN15 Mbps access linkinstitutionalcache2: Application Layer36Client Cache: Conditional GETrGoal: dont send object if cache has up-to-date cached versionrcache: specify date of cached copy in HTTP requestIf-modified-since: rserver: response contains no object i

46、f cached copy is up-to-date: HTTP/1.0 304 Not ModifiedcacheserverHTTP request msgIf-modified-since: HTTP responseHTTP/1.0 304 Not Modifiedobject not modifiedHTTP request msgIf-modified-since: HTTP responseHTTP/1.0 200 OKobject modifiedDistributed CacheclientProxyserverclientorigin serverorigin serve

47、ruMany caches are cooperativeuLocal access is missed, the cache links neighborsuThru http or ICPuIf there is no data in neighbours, access origin serveruDifficult to operateServer Caches: ClusterrMultiple servers are constructed in clusterrThe same or different contentsrThe connection is transferred

48、 to the light load server(cache)vHigh parallelism,reliabilityvLoad balance neededvObject location algorithm neededrAdopted broadly2: Application Layer39FTP: the file transfer protocolrtransfer file to/from remote hostrclient/server modelvclient: side that initiates transfer (either to/from remote)vs

49、erver: remote hostrftp: RFC 959rftp server: port 21file transferFTPserverFTPuserinterfaceFTPclientlocal filesystemremote filesystemuser at host2: Application Layer40FTP: separate control, data connectionsrFTP client contacts FTP server at port 21, TCP is transport protocolrclient authorized over con

50、trol connectionrclient browses remote directory by sending commands over control connection.rwhen server receives file transfer command, server opens 2nd TCP connection (for file) to clientrafter transferring one file, server closes data connection.FTPclientFTPserverTCP control connectionport 21TCP

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 大学
版权提示 | 免责声明

1,本文(计算机网络课件:Chapter2-2.ppt)为本站会员(罗嗣辉)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!


侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|