山东大学计算机网络英语课件07Application Layer_第1页
山东大学计算机网络英语课件07Application Layer_第2页
山东大学计算机网络英语课件07Application Layer_第3页
山东大学计算机网络英语课件07Application Layer_第4页
山东大学计算机网络英语课件07Application Layer_第5页
已阅读5页,还剩83页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Application LayerChapter 7CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011DNS Domain Name SystemElectronic MailThe WebStreaming Audio and VideoContent DeliveryRevised: August 2011The Application LayerCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall

2、and D. Wetherall, 2011Uses transport services to build distributed applicationsPhysicalLinkNetworkTransportApplicationDNS Domain Name SystemThe DNS resolves high-level human readable names for computers to low-level IP addressesDNS name space Domain Resource records Name servers CN5E by Tanenbaum &

3、Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The DNS Name Space (1)DNS namespace is hierarchical from the root downDifferent parts delegated to different organizationsThe computer CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The DNS Name Sp

4、ace (2)Generic top-level domains are controlled by ICANN who appoints registrars to run themThis one was controversialCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Domain Resource Records (1)The key resource records in the namespace are IP addresses (A/AAAA) an

5、d name servers (NS), but there are others too (e.g., MX)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Domain Resource Records (2)A portion of a possible DNS database for cs.vu.nl.IP addresses of computersName serverMail gatewaysCN5E by Tanenbaum & Wetherall, Pe

6、arson Education-Prentice Hall and D. Wetherall, 2011Name Servers (1)Name servers contain data for portions of the name space called zones (circled).One zoneCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Name Servers (2)CN5E by Tanenbaum & Wetherall, Pearson Educ

7、ation-Prentice Hall and D. Wetherall, 2011Finding the IP address for a given hostname is called resolution and is done with the DNS protocol.Resolution:Computer requests local name server to resolveLocal name server asks the root name serverRoot returns the name server for a lower zoneContinue down

8、zones until name server can answerDNS protocol:Runs on UDP port 53, retransmits lost messagesCaches name server answers for better performanceName Servers (3)Example of a computer looking up the IP for a nameCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Electro

9、nic MailCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Architecture and services The user agent Message formats Message transfer Final delivery Architecture and Services (1)The key components and steps (numbered) to send emailCN5E by Tanenbaum & Wetherall, Pears

10、on Education-Prentice Hall and D. Wetherall, 2011Architecture of the email systemArchitecture and Services (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Paper mailElectronic mailEnvelopeMessage (= header and body)The User AgentWhat users see interface elemen

11、ts of a typical user agentCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Message Formats (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Header fields related to message transport; headers are readable ASCII textMessage Fo

12、rmats (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Other header fields useful for user agentsMessage Formats (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011MIME header fields used to describe what content is in the b

13、ody of the messageMessage Formats (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Common MIME content types and subtypesMessage Formats (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Putting it all together: a multipart

14、 message containing HTML and audio alternatives.One part (HTML)Another(audio)Message Transfer (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Messages are transferred with SMTP (Simple Mail Transfer Protocol)Readable text commandsSubmission from user agent to

15、MTA on port 587One MTA to the next MTA on port 25Other protocols for final delivery (IMAP, POP3)Message Transfer (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Sending a message:From Alice to BobSMTP commands are marked pink . . . (rest of message) . . . Mess

16、age Transfer (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Common SMTP extensions (not in simple example)Final Delivery (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011User agent uses protocol like IMAP for final deliv

17、eryHas commands to manipulate folders / messages rightAlternatively, a Web interface (with proprietary protocol) might be usedThe World Wide WebCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Architectural overview Static Web pages Dynamic pages and Web applicati

18、ons HTTP HyperText Transfer Protocol The mobile Web Web search Architectural Overview (1)HTTP transfers pages from servers to browsersCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Architectural Overview (2)Pages are named with URLs (Uniform Resource Locators)Ex

19、ample: /comics.phpCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011OurfocusProtocolPage on serverServerCommon URL protocolsArchitectural Overview (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Steps a client (browser) takes

20、 to follow a hyperlink:Determine the protocol (HTTP)Ask DNS for the IP address of serverMake a TCP connection to serverSend request for the page; server sends it backFetch other URLs as needed to display the pageClose idle TCP connectionsSteps a server takes to serve pages: Accept a TCP connection f

21、rom clientGet page request and map it to a resource (e.g., file name)Get the resource (e.g., file from disk)Send contents of the resource to the client.Release idle TCP connectionsArchitectural Overview (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Content t

22、ype is identified by MIME typesBrowser takes the appropriate action to display Plug-ins / helper apps extend browser for new typesArchitectural Overview (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011To scale performance, Web servers can use:Caching, multiple

23、 threads, and a front end Architectural Overview (6)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Server steps, revisited:Resolve name of Web page requestedPerform access control on the Web pageCheck the cacheFetch requested page from disk or run programDetermi

24、ne the rest of the responseReturn the response to the clientMake an entry in the server logArchitectural Overview (7)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Cookies support stateful client/server interactionsServer sends cookies (state) with page response

25、Client stores cookies across page fetchesClient sends cookies back to server with requestsExamples of cookiesStatic Web Pages (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Static Web pages are simply filesHave the same contents for each viewingCan be visuall

26、y rich and interactive nonetheless:HTML that mixes text and imagesForms that gather user inputStyle sheets that tailor presentationVector graphics, videos, and more (over) . . .Static Web Pages (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Progression of fea

27、tures through HTML 5.0Dynamic Pages & Web Applications (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Dynamic pages are generated by programs running at the server (with a database) and the clientE.g., PHP at server, JavaScript at clientPages vary each time l

28、ike using an applicationDynamic Pages & Web Applications (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Web page that gets form input and calls a server program PHP server program that creates a custom Web pageResulting Web page (for inputs “Barbara” and “32”

29、)PHP callsDynamic Pages & Web Applications (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011JavaScript program produces result page in the browserFirst page with form, gets input and calls program aboveDynamic Pages & Web Applications (4)CN5E by Tanenbaum & Wet

30、herall, Pearson Education-Prentice Hall and D. Wetherall, 2011The difference between server and client programsServer-side scripting with PHPClient-side scripting with JavaScriptDynamic Pages & Web Applications (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011W

31、eb applications use a set of technologies that work together, e.g. AJAX:HTML: present information as pages.DOM: change parts of pages while they are viewed.XML: let programs exchange data with the server.Asynchronous way to send and retrieve XML data.JavaScript as a language to bind all this togethe

32、r.Dynamic Pages & Web Applications (6)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011The DOM (Document Object Model) tree represents Web pages as a structure that programs can alterDynamic Pages & Web Applications (7)CN5E by Tanenbaum & Wetherall, Pearson Educat

33、ion-Prentice Hall and D. Wetherall, 2011XML captures document structure, not presentation like HTML. Ex:Dynamic Pages & Web Applications (8)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Web applications use a set of technologies, revisited:HTTP (1)CN5E by Tanen

34、baum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011HTTP (HyperText Transfer Protocol) is a request-response protocol that runs on top of TCPFetches pages from server to clientServer usually runs on port 80Headers are given in readable ASCIIContent is described with MIME typesPro

35、tocol has support for pipelining requestsProtocol has support for caching HTTP (2)HTTP uses persistent connections to improve performanceCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011One connection for each requestSequential requests on one connectionPipelined

36、requests on one connectionHTTP (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011HTTP has several request methods.Fetch a pageUsed to send input data to a server programHTTP (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

37、Response codes tell the client how the request fared:HTTP (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Many headers carry key information:FunctionExample HeadersBrowser capabilities(client server)User-Agent, Accept, Accept-Charset, Accept-Encoding, Accept-L

38、anguageCaching related(mixed directions)If-Modified-Since, If-None-Match, Date, Last-Modified, Expires, Cache-Control, ETagBrowser context(client server)Cookie, Referer, Authorization, HostContent delivery(server client)Content-Encoding, Content-Length, Content-Type, Content-Language, Content-Range,

39、 Set-CookieHTTP (6)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011HTTP caching checks to see if the browser has a known fresh copy, and if not if the server has updated the pageUses a collection of headers for the checksCan include further levels of caching (e.g

40、., proxy)The Mobile WebCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Mobiles (phones, tablets) are challenging as clients: Relatively small screens Limited input capabilities, lengthy input. Network bandwidth is limited Connectivity may be intermittent. Computi

41、ng power is limitedStrategies to handle them:Content: servers provide mobile-friendly versions; transcoding can also be usedProtocols: no real need for specialized protocols; HTTP with header compression sufficientWeb SearchCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wether

42、all, 2011Search has proved hugely popular, in tandem with advertising that has proved hugely profitableA simple interface for users to navigate the WebSearch engine requires:Content from all sites, accessed by crawling. Follow links to new pages, but beware programs.Indexing, which benefits from kno

43、wn and discovered structure (such as XML) to increase relevance Streaming Audio and VideoCN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Audio and video have become key types of traffic, e.g., voice over IP, and video streaming.Digital audio Digital video Streami

44、ng stored media Streaming live media Real-time conferencing Digital Audio (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011ADC (Analog-to-Digital Converter) produces digital audio from a microphoneTelephone: 8000 8-bit samples/second (64 Kbps); computer audio i

45、s usually better quality (e.g., 16 bit)Continuous audio (sine wave)Digital audio(sampled, 4-bit quantized)ADCDigital Audio (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Digital audio is typically compressed before it is sentLossy encoders (like AAC) exploit

46、human perceptionLarge compression ratios (can be 10X)Sensitivity of the ear varies with frequencyA loud tone can mask nearby tonesDigital Video (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Video is digitized as pixels (sampled, quantized)TV quality: 640 x48

47、0 pixels, 24-bit color, 30 times/secVideo is sent compressed due to its large bandwidthLossy compression exploits human perceptionE.g., JPEG for still images, MPEG, H.264 for videoLarge compression ratios (often 50X for video)Video is normally 1 Mbps, versus 10 kbps for speech and 100 kbps for music

48、 Digital Video (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011JPEG lossy compression sequence for one image:Step 1Step 2Step 3Step 5Digital Video (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Step 1: Pixels are mapped

49、 to luminance/chrominance (YCbCr) color space and chrominance is sub-sampledThe eye is less sensitive to chrominanceInput 24-bit RGB pixels8-bit luminance pixels8-bit chrominances for every 4 pixelsDigital Video (4)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011

50、Step 2: Each component block is transformed to spatial frequencies with DCT (Discrete Cosine Transformation)Captures the key image featuresOne component blockTransformed blockDigital Video (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Step 3: DCT coefficient

51、s are quantized by dividing by thresholds; reduces bits in higher spatial frequenciesTop left element is differenced over blocks (Step 4)/=InputThresholdsOutputDigital Video (6)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Step 5: The block is run-length encode

52、d in a zig-zag order. Then it is Huffman coded before sending (Step 6)Order in which the block coefficients are sent Digital Video (7)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011MPEG compresses over a sequence of frames, further using motion tracking to remov

53、e temporal redundancyI (Intra-coded) frames are self-containedP (Predictive) frames use block motion predictionsB (Bidirectional) frames may base prediction on future frameThree consecutive frames with stationary and moving componentsStreaming Stored Media (1)CN5E by Tanenbaum & Wetherall, Pearson E

54、ducation-Prentice Hall and D. Wetherall, 2011A simple method to stream stored media, e.g., for video on demand, is to fetch the video as a file downloadBut has large startup delay, except for short filesStreaming Stored Media (2)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. W

55、etherall, 2011Effective streaming starts the playout during transportWith RTSP (Real-Time Streaming Protocol)Streaming Stored Media (3)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Key problem: how to handle transmission errorsStrategyAdvantageDisadvantageUse r

56、eliable transport (TCP)Repairs all errorsIncreases jitter significantlyAdd FEC (e.g., parity)Repairs most errorsIncreases overhead, decoding complexity and jitterInterleave mediaMasks most errorsSlightly increases decoding complexity and jitterStreaming Stored Media (4)CN5E by Tanenbaum & Wetherall,

57、 Pearson Education-Prentice Hall and D. Wetherall, 2011Parity packet can repair one lost packet in a group of NDecoding is delayed for N packetsStreaming Stored Media (5)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Interleaving spreads nearby media samples ove

58、r different transmissions to reduce the impact of lossLoss reduces temporal resolution; doesnt leave a gapPacket streamMedia samplesStreaming Stored Media (6)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Key problem: media may not arrive in time for playout due

59、 to variable bandwidth and loss/retransmissionsClient buffers media to absorb jitter; we still need to pick an achievable media rate Safety margin, to avoid a stallCan pause server (or go ahead and save to disk) Streaming Stored Media (7)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall

60、 and D. Wetherall, 2011RTSP commandsSent from player to server to adjust streamingStreaming Live Media (1)CN5E by Tanenbaum & Wetherall, Pearson Education-Prentice Hall and D. Wetherall, 2011Streaming live media is similar to the stored case plus: Cant stream faster than “live rate” to get aheadUsua

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论