版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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 “l(fā)ive rate” to get aheadUsua
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025版信托資金借貸合同合規(guī)性審查條款3篇
- 二零二五年度古董家具修復(fù)木工合同范本4篇
- 二零二五年度智能鎖定制加工合同范本4篇
- 2025版環(huán)保木工材料供應(yīng)與分包工程合同4篇
- 2025版事業(yè)單位聘用合同續(xù)簽與績效考核及晉升標(biāo)準(zhǔn)協(xié)議3篇
- 2025版外教中介聘請(qǐng)合同標(biāo)準(zhǔn)范本3篇
- 農(nóng)產(chǎn)品倉儲(chǔ)庫存管理與優(yōu)化考核試卷
- 2025版信托投資公司外匯存款賬戶管理合同3篇
- 2025年加盟冰淇淋店合同模板
- 2025年加盟加盟推廣合同
- 道路瀝青工程施工方案
- 內(nèi)陸?zhàn)B殖與水產(chǎn)品市場(chǎng)營銷策略考核試卷
- 票據(jù)業(yè)務(wù)居間合同模板
- 承包鋼板水泥庫合同范本(2篇)
- DLT 572-2021 電力變壓器運(yùn)行規(guī)程
- 公司沒繳社保勞動(dòng)仲裁申請(qǐng)書
- 損傷力學(xué)與斷裂分析
- 2024年縣鄉(xiāng)教師選調(diào)進(jìn)城考試《教育學(xué)》題庫及完整答案(考點(diǎn)梳理)
- 車借給別人免責(zé)協(xié)議書
- 應(yīng)急預(yù)案評(píng)分標(biāo)準(zhǔn)表
- “網(wǎng)絡(luò)安全課件:高校教師網(wǎng)絡(luò)安全與信息化素養(yǎng)培訓(xùn)”
評(píng)論
0/150
提交評(píng)論