版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、7 Application LayerApplication LayerIntroduction Domain Name System (DNS) Hierarchical Namespace & Resource Records Name servers & Name Resolution File Transfer Protocol (FTP) Email System and Protocols System Components Message Format SMTP,POP3,IMAP World Wide Web WWW Architecture Hypertext Transfe
2、r Protocol (HTTP) Homework Introduction Duties and Features of Application LayerProviding various applications to end usersMaximum number of protocols and most complexEach protocol is specified to a type of application, no general-purpose protocolsConventional Internet Application Protocols Client-s
3、erver ParadigmThe tasks, capabilities and protocol machines are different at each side.Client-side requests service, Server-side provides service.Forms the basis of computer networksPeer-to-peer ParadigmThe protocol machines are the same at both sidesThe same state-flow diagramThe same set of tasks
4、and responsibilitiesThe same set of capabilitiesBitTorrent, eMule, DHT, KADDomain Name System (DNS)Hierarchical Namespace &Resource RecordsDNS: Domain Name SystemOut-dated “hosts.txt”A client-server application that identifies each host on the Internet with a unique user-friendly name(domain name),
5、e.g. instead of 30Providing support for other applicationsTranslating domain name (host name) to IP address C function: gethostbyname()Windows XP commands: nslookup, ipconfig/displaydns, ipconfig/flushdnsFeaturesUDP datagram, DNS ServerHierarchical namespace: Host have a composite names that are all
6、 hierarchically organizedDistributed databaseNaming follows organizational boundaries, not physical networks Hierarchical NamespaceWithin an organizationSubdivision possibleArbitrary levels possible (maximum depth =128) Not standardized, controlled locally by the organizationNaming policy by the pat
7、h upward from leaf to root, separated by “.” comedugovintmilnetorgaecnzwmitcsxxcsedubuptGeneric domainsCountry domainsUnnamed rootTop level domains2nd level domainsZonesA zone corresponds to an administrative authority that is responsible for that portion of the hierarchy e.g: bupt controls *.Resour
8、ce Records (RR)Each domain in the DNS has one or more Resource Records (RRs)Each RR has the following informationOwner: the domain nameType: specifies the type of the resource in this RRSOA Start Of Authority, identifies the zone A Host Address MX Mail ExchangerCNAME Canonical Name, aliasHINFO Host
9、InformationClass: specifies the protocol family to useIN the Internet systemTTL: specifies the Time To Live (in unit of second) of the cached RRsSample of DNS DatabaseType Value Domain nameTime-to-liveClass Name servers &Name Resolution DNS Client-Server InteractionClient: resolversoftware running o
10、n client, access at least one name serverMultiple DNS servers usedArranged in hierarchyEach server has authority over a portion of the hierarchyEach server contains all the records for the hosts in its zoneHow does a server know about other servers that are responsible for the other zones?Every serv
11、er knows the rootRoot server knows about all top-level domainsEvery server knows the servers further down the hierarchyHierarchy of Name ServersPrimary and Secondary ServersDNS uses backup serversPrimary server: creates, maintains, and updates information about its zoneSecondary server: gets its inf
12、ormation from a primary server; as a backup server in case of failureBoth servers have authority over their zoneISPs Offering DNS service to subscribersSmall organizations and individualsOnly need domain names for computers running serversContract with an ISP for domain serviceDNS LookupApplications
13、Becoming DNS clientSending request first to local name serverLocal name serverListening at port 53, normally using UDPIf answer known, returns responseIf answer unknownRequests top-level name serverFollows linksUntil reaching Authoritative Name Server, which performs name translation and returns res
14、ponse Name Resolution MethodsRecursive resolutionA query is made to a local name serverIf the queried server does not have the information, it must make a query to anotherIterative resolutionAn iterative query is made to a name server, which may then respond with the address of another serverthe loc
15、al name server (on behalf of resolver) then queries that server (which might respond with the address of another server, and so on)Commonly used by name servers on InternetExample of Recursive ResolutionExample of Iterative ResolutionDNS CachingServer always caches answersHost can cache answersWorks
16、 well because high locality of referenceTTLFile Transfer Protocol (FTP)FTPFile Transfer Protocol (RFC959)Used to transfer files between hostsUsed to manipulate remote filesAuthList directoriesDelete filesRename filesUsing client/server modelUsing TCP for reliable transfersFTP Model (1)File SystemSer
17、ver PIServer DTPClient PIClient DTPUser InterfaceFile SystemUserFTP serverFTP clientControl ConnectionData ConnectionFTP Model (2)PI (Protocol Interpreter): Implements FTP protocol, interpreting FTP commands and replies. DTP (Data Transfer Process): Establishes and manages the data connection. Contr
18、ol Connection: The communication path between the client-PI and server-PI for the exchange of FTP commands and repliesData Connection: A full duplex connection over which data is transferredThe data transferred may be a part of a file, an entire fileFTP Model (3)FTP ClientUsers interact with FTP Cli
19、ent directlyActive open of control connectionControl connection uses ASCII plain-textSends commands (over control connection)Receives replies (over control connection)Data connection used to transfer file dataFTP ServerSystem process“Listens” for connection on well-known port 21Receives commandsSend
20、s repliesFTP Control Connection & Data ConnectionControl connectionRemain alive as long as the user keeps FTP session activePassing commands and repliesUsed to coordinate the ports used for data connection and establish data connectionServer well-known port: 21Data connectionBe created dynamically w
21、hen needed One data connection persists for one file transferUsed for data transmissionServer well-known port: 20FTP connections: Example of Uploading FileRFC959标准FTP的其他特性Traditional FTP vs. Anonymous FTP主动与被动(从服务器角度PORT/PASSIVE)主动:服务器向客户端发起TCP数据连接被动:服务器等待客户端建立TCP数据连接会话实例第三方传输:FXP断点续传FTP的缺陷传输中止,存在半个
22、文件未能传输文件属性(最后一次修改时间,文件权限等)Email System and Protocols System ComponentsWhat is Email?Electronic Mail (email, e-mail)Provides a means to send electronic messages from one person to another asynchronouslyOne of the most popular applications on the Internet and one of the most important communication me
23、thods todayEmail service can be provided byISPs: , , , , Corporations and institutes: , , , Bundled with other services: , , Components Of Email SystemInternetUser AgentMail ServerMail ServerUser AgentSMTPSMTPPOP3SenderReceiverMail Server of Sender SideMail Server of Receiver SideSpoolingUser mailbo
24、xSMTPSMTPPOP3Components Of Email SystemUA (User Agent)end-user mail programInterface between the end users and the email servers E.g., outlook, foxmail, Mail ServerResponsible for transmitting/receiving emails and reporting status information about mail transferring to the mail senderBoth a client a
25、nd a serverEmail protocolsSMTP: used for sending an emailPOP3: used for receiving an emailBasic Functions of Email SystemComposition - creating messages and answersTransfer - moving messages from the originator to the recipientReporting - informing the originator what happened to the messageDisplayi
26、ng - showing the messagesMessage Format (RFC822,2822)Internet Message Format (RFC822/2822)Message (ASCII)Messages consist of (1)a primitive envelope(2) some number of header fields, (3) a blank line(4) and then the message bodyRFC 822 does not clearly distinguish the envelope fields from the header
27、fields Each header field consists of a single line of ASCII text:(1)field name(2)a colon(3)for most fields, a value. 40Message Field DefinitionsCategoriesHeaderMeaningOriginator fieldsFrom:Person or people who created the messageSender:Email address of the actual senderReply-to:Email address to whic
28、h replies should be sentDestination address fieldsTo:Email address(es) of primary recipient(s)Cc:Email address(es) of secondary recipient(s)Bcc:Email address(es) for blind carbon copiesThe origination date fieldDate:The date and time the message was sentIdentification fieldsMessage-Id:Unique number
29、for referencing this message laterReferences:Other relevant Message-IdsInformation fieldsSubject:Short summary of the message for the one-line displayKeywords:User chosen keywordTrace fieldsReceived:Line added by each transfer agent along the routeReturn-Path:Can be used to identify a path back to t
30、he senderExample of Mail MessageThe header is everything up to the blank line, and the body is everything after the blank lineFrom: John Doe Sender: Michael Jones To: Mary Smith Subject: Saying HelloDate: Fri, 21 Nov 1997 09:55:06 -0600Message-ID: This is a message just to say hello.So, Hello. Autho
31、r of the message, requiredMailbox responsible for the actual transmission of the message, optional Address(es) of the primary recipient(s) of the messageheadersbody Problem of RFC 822: Only 7 bit ASCII format can be useda blank linePostal Mail vs. EmailForouzanMIMEMultipurpose Internet Mail Extensio
32、nExtension for multipart & multimedia emailAdditional mail headers define content Type: text, image, audio, video, application and subtype within (eg text/html, image/gif)Encoding (ASCII , quoted printable, base64) to handle arbitrary binary data when email system can only handle normal ASCII charsS
33、upports multipart message content type each part has its own type and encodingMIME messages can be sent using the existing mail programs and protocolsWidely used nowMIME: New HeadersMIME: Content Types and Subtypes46MIME: Message Example (1)Date: Sat, 07 Dec 2002 16:37:32 +0800From: Adun Gaos X-Acce
34、pt-Language: zh-cnMIME-Version: 1.0To: adungaosSubject: MIME message!Content-Type: multipart/mixed; boundary=080202030206040206090704This is a multi-part message in MIME format.080202030206040206090704Content-Type: text/html; charset=us-asciiContent-Transfer-Encoding: 7bit This is a MIME message. He
35、re is body.080202030206040206090704Content-Type: application/x-gtar; name=binary.tgzContent-Transfer-Encoding: base64Content-Disposition: inline; filename=binary.tgzH4sIABmy8T0AA+3OsQ3CMBQEUI/iEb6dBM9jhIRogpSQgu1BQhQUiCpU7zVX3BV3vMx9uaddRYk4RKSIKG36yLcUbWrjMJQo9bmv41BTjn1vvWzrrS85p37a5nO/rt92v3oAAAA
36、AAAAAAAD4oweF/KCgACgAAA=080202030206040206090704-47MIME: Message Example (2)When you save the above as .eml file and open it with outlook, you can see:Example of Base64Base64: a specific MIME content transfer encoding. 6 bit-data is converted into an 8-bit ASCII characterABCDEFGHIJKLMNOPQRSTUVWXYZab
37、cdefghijklmnopqrstuvwxyz0123456789+- (pad/=)SMTP,POP3,IMAP(RFC821,1939,1730)SMTP (RFC821)Simple Mail Transfer ProtocolSMTP is a simple ASCII protocolSMTP server listens to port 25 SMTP client establishes a TCP connection to portUsed in transferring mail messages from UA to mail server, and between m
38、ail servers SMTP Basic ModelMTAMTASMTP clientSMTP serverFile SystemFile SystemUserSMTP commands/replies and mail MTA: Mail Transfer Agent, the mail server using SMTPMessage TransferTransferring a message from elinore to carolyn.POP: Basic ModelTransfer mail from mail server to UASMTP/POP Mail Server
39、User AgentFile SystemInternetPOPSMTPSMTP Server: always “on and listening” via TCP port 25 holds incoming mail for userPOP Mail Access Server: runs the POP3 service by listening on TCP port 110Clients: connect to server to manipulate mail using POP3POP: Features Essentially store Mail is stored on t
40、he server until the client connects and then is downloaded to the client. You MAY be able to leave a copy on the serverSimple protocol and widely usedSimilar to SMTP command/reply lockstep protocolUsed to retrieve mail for a single user, requires authenticationMany clients available such as Eudora,
41、foxmail, outlookCommon used version: RFC1939: POP3 (POP Version 3)For mobile users or users that use multiple machines during the daySolution: IMAP (Internet Message Access Protocol)Using POP3 to Fetch 3 MessagesIMAP: Internet Message Access Protocol For mobile users or users that use multiple machi
42、nes during the dayIMAP (Internet Message Access Protocol) RFC1730: IMAP4POP3 vs IMAPWorld Wide Web (WWW) WWW ArchitectureWWW: World Wide WebA distributed hyper-media system, including multiple media information such as text, graph, image, audio, even videoInformation is distributed in Internet, stor
43、ed in web servers and accessed by hyperlinksClient/Server mode, with browser program as clientClient and server interact with HTTP: Hyper-Text Transfer ProtocolWWW documents are located with URL: Uniform Resource LocatorWWW documents are written in HTML: HyperText Markup LanguageSearching engines fa
44、cilitate user to find information neededArchitectural Overview of WWWClient Side: BrowserAn application program, as users interface to WebFetching information (web page) from Web serverDisplaying information for usersAfter the user clicks on a hyperlink, BrowserDetermines URL, name of the linked web
45、 page, eg. /example.htmlAsks DNS for the IP address of Establishes a TCP connection to replied IP addressAsks a request of web page example.html (HTTP)Releases TCP connection upon receiving the requested web pageDisplays all the texts in example.html (HTML)Fetches and displays all images in the file
46、The Client Side(a) A browser plug-in. (b) A helper application.Web ServerStores set of Web documentsResponds to request from browser by sending copy of documentSteps of servers loopAccepts a TCP connection from a browserResolves name of the web page requiredFetches the requested page from diskReturn
47、s the reply to the clientReleases the TCP connectionWeb DocumentsAlso called a web page (HTML)TypesStatic web pageStored in fileUnchangingDynamic web pageCan change whenever a server receives a request Generated on server sideOutput from a program on server, usually a scriptActive web pageCan change
48、 after the document has been loaded into a browserGenerated on client sideConsists of a computer program, known as Java, running in browser (applet)HTML HyperText Markup Language(a) The HTML for a sample Web page. (b) The formatted page.(b)Static Web PageDynamic Web PageActive Web PageClient-Side Dynamic Web Page GenerationT
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 农副产品购销合同(2024版)
- 《工程造价课件U》课件
- 中考地理中国的交通复习课件人教
- 毕设开题报告范文
- 2024版技术开发合作合同范例3篇
- 知识产权授权协议范本完整版
- 钢结构承包安全协议书
- 二零二四版医疗设备采购与维护合同3篇
- 《ie工作改善方法》课件
- 2024年度新建住宅小区物业服务管理合同
- 第五讲铸牢中华民族共同体意识-2024年形势与政策
- 2024年贵州公务员考试申论试题(B卷)
- 潮汕音乐课件教学课件
- 小学生人际交往篇-做一个受欢迎的人
- 贵州省黔南州2024年中考历史真题试卷(含答案)
- 【课件】 2024消防月主题培训:全民消防 生命至上
- 新苏教版五年级科学上册活动手册答案
- JJF(浙) 1149-2018 生物实验用干式恒温器校准规范
- 2024-2025学年五年级科学上册第二单元《地球表面的变化》测试卷(教科版)
- 九年级物理全册教案【人教版】
- 2024义务教育《英语课程标准》(2022版)
评论
0/150
提交评论