已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Application Layer,2-1,Chapter 2Application Layer,Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith RossAddison-WesleyMarch 2012,2.3 FTP 2.4 electronic mailSMTP, POP3, IMAP,Application Layer,2-2,Chapter 2: outline,2.1 principles of network applicationsapp architecturesapp requirements2.2 Web and HTTP2.3 FTP 2.4 electronic mailSMTP, POP3, IMAP2.5 DNS,2.6 P2P applications2.7 socket programming with UDP and TCP,Application Layer,2-3,FTP: the file transfer protocol,file transfer,local filesystem,remote filesystem,user at host,transfer file to/from remote hostclient/server modelclient: side that initiates transfer (either to/from remote)server: remote hostftp: RFC 959ftp server: port 21,Application Layer,2-4,FTP: separate control, data connections,FTP client contacts FTP server at port 21, using TCP client authorized over control connectionclient browses remote directory, sends commands over control connectionwhen server receives file transfer command, server opens 2nd TCP data connection (for file) to clientafter transferring one file, server closes data connection,FTPclient,FTPserver,TCP control connection,server port 21,TCP data connection,server port 20,server opens another TCP data connection to transfer another filecontrol connection: “out of band”FTP server maintains “state”: current directory, earlier authentication,Application Layer,2-5,FTP commands, responses,sample commands:sent as ASCII text over control channelUSER usernamePASS passwordLIST return list of file in current directoryRETR filename retrieves (gets) fileSTOR filename stores (puts) file onto remote host,sample return codesstatus code and phrase (as in HTTP)331 Username OK, password required125 data connection already open; transfer starting425 Cant open data connection452 Error writing file,Application Layer,2-6,Chapter 2: outline,2.1 principles of network applicationsapp architecturesapp requirements2.2 Web and HTTP2.3 FTP 2.4 electronic mailSMTP, POP3, IMAP2.5 DNS,2.6 P2P applications2.7 socket programming with UDP and TCP,Application Layer,2-7,Electronic mail,Three major components: user agents mail servers simple mail transfer protocol: SMTPUser Agenta.k.a. “mail reader”composing, editing, reading mail messagese.g., Outlook, Thunderbird, iPhone mail clientoutgoing, incoming messages stored on server,Application Layer,2-8,Electronic mail: mail servers,mail servers:mailbox contains incoming messages for usermessage queue of outgoing (to be sent) mail messagesSMTP protocol between mail servers to send email messagesclient: sending mail server“server”: receiving mail server,Application Layer,2-9,Electronic Mail: SMTP RFC 2821,uses TCP to reliably transfer email message from client to server, port 25direct transfer: sending server to receiving serverthree phases of transferhandshaking (greeting)transfer of messagesclosurecommand/response interaction (like HTTP, FTP)commands: ASCII textresponse: status code and phrasemessages must be in 7-bit ASCI,Application Layer,2-10,Scenario: Alice sends message to Bob,1) Alice uses UA to compose message “to” 2) Alices UA sends message to her mail server; message placed in message queue3) client side of SMTP opens TCP connection with Bobs mail server,4) SMTP client sends Alices message over the TCP connection5) Bobs mail server places the message in Bobs mailbox6) Bob invokes his user agent to read message,1,2,3,4,5,6,Alices mail server,Bobs mail server,Application Layer,2-11,Sample SMTP interaction,S: 220 C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 alicecrepes.fr. Sender ok C: RCPT TO: S: 250 . Recipient ok C: DATA S: 354 Enter mail, end with . on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 closing connection,Application Layer,2-12,Try SMTP interaction for yourself:,telnet servername 25see 220 reply from serverenter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader),Application Layer,2-13,SMTP: final words,SMTP uses persistent connectionsSMTP requires message (header & body) to be in 7-bit ASCIISMTP server uses CRLF.CRLF to determine end of message,comparison with HTTP:HTTP: pullSMTP: pushboth have ASCII command/response interaction, status codesHTTP: each object encapsulated in its own response msgSMTP: multiple objects sent in multipart msg,Application Layer,2-14,Mail message format,SMTP: protocol for exchanging email msgsRFC 822: standard for text message format:header lines, e.g.,To:From:Subject:different from SMTP MAIL FROM, RCPT TO: commands!Body: the “message” ASCII characters only,header,body,blankline,Application Layer,2-15,Mail access protocols,SMTP: delivery/storage to receivers servermail access protocol: retrieval from serverPOP: Post Office Protocol RFC 1939: authorization, download IMAP: Internet Mail Access Protocol RFC 1730: more features, including manipulation of stored msgs on serverHTTP: gmail, Hotmail, Yahoo! Mail, etc.,SMTP,SMTP,mail accessprotocol,receivers mail server,(e.g., POP, IMAP),Application Layer,2-16,POP3 protocol,authorization phaseclient commands: user: declare usernamepass: passwordserver responses+OK-ERRtransaction phase, client:list: list message numbersretr: retrieve message by numberdele: deletequit,C: list S: 1 498 S: 2 912 S: . C: retr 1 S: S: . C: dele 1 C
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 常州武进市三河口高级中学高三物理周周练
- 中职第一学年(市场营销)市场调研实务2026年综合测试题及答案
- 2025年高职轨道交通(列车驾驶)试题及答案
- 2025-2026年高三化学(基础巩固)下学期期末检测卷
- 2025年中职(环境监测技术)固体废物检测实操试题及答案
- 2025年高职种子生产与经营(种子质量检验)试题及答案
- 2025年大学护理学(人力资源管理)试题及答案
- 2025年大学农业工程(农业机械操作实训)试题及答案
- 2025年大学车辆工程(汽车维修技术)试题及答案
- 高职第二学年(食品营养与检测)食品成分分析2026年阶段测试题及答案
- 钢结构及玻璃雨棚施工方案
- 报案书(参考范文)
- 汽车行业销售经理聘用合同
- JJG 270-2008血压计和血压表
- 检验检测行业市场概况分析报告
- 苏科版物理八年级上册同步练习
- 节温器的工作原理与检修课件
- 注册会计师CPA2022年《审计》科目考试真题与答案解析
- 《家国情怀》的主题班会
- petrel操作指南精讲
- 2019国家安全知识竞赛试题试题及答案大全(共471题)
评论
0/150
提交评论