3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学

上传人:cn****1 文档编号:584807562 上传时间:2024-09-01 格式:PPT 页数:17 大小:453.50KB
返回 下载 相关 举报
3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学_第1页
第1页 / 共17页
3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学_第2页
第2页 / 共17页
3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学_第3页
第3页 / 共17页
3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学_第4页
第4页 / 共17页
3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学_第5页
第5页 / 共17页
点击查看更多>>
资源描述

《3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学》由会员分享,可在线阅读,更多相关《3rdEditionChapter2OldDominionUniversity第三版2章奥多明尼昂大学(17页珍藏版)》请在金锄头文库上搜索。

1、Application Layer 2-1Chapter 2Application LayerComputer Networking: A Top Down Approach 6th edition Jim Kurose, Keith RossAddison-WesleyMarch 20212.3 FTP 2.4 electronic mailSMTP, POP3, IMAPApplication Layer 2-2Chapter 2: outline2.1 principles of network applicationsapp architecturesapp requirements2

2、.2 Web and HTTP2.3 FTP 2.4 electronic mailSMTP, POP3, IMAP2.5 DNS2.6 P2P applications2.7 socket programming with UDP and TCPApplication Layer 2-3FTP: the file transfer protocolfile transferFTPserverFTPuserinterfaceFTPclientlocal filesystemremote filesystemuser at hostvtransfer file to/from remote ho

3、stvclient/server modelclient: side that initiates transfer (either to/from remote)server: remote hostvftp: RFC 959vftp server: port 21Application Layer 2-4FTP: separate control, data connectionsvFTP client contacts FTP server at port 21, using TCP vclient authorized over control connectionvclient br

4、owses remote directory, sends commands over control connectionvwhen server receives file transfer command, server opens 2nd TCP data connection (for file) to clientvafter transferring one file, server closes data connectionFTPclientFTPserverTCP control connection,server port 21TCP data connection,se

5、rver port 20vserver opens another TCP data connection to transfer another filevcontrol connection: “out of bandvFTP server maintains “state: current directory, earlier authenticationApplication Layer 2-5FTP commands, responsessample commands:vsent as ASCII text over control channelvUSER usernamevPAS

6、S passwordvLIST return list of file in current directoryvRETR filename retrieves (gets) filevSTOR filename stores (puts) file onto remote hostsample return codesvstatus code and phrase (as in HTTP)v331 Username OK, password requiredv125 data connection already open; transfer startingv425 Cant open d

7、ata connectionv452 Error writing fileApplication Layer 2-6Chapter 2: outline2.1 principles of network applicationsapp architecturesapp requirements2.2 Web and HTTP2.3 FTP 2.4 electronic mailSMTP, POP3, IMAP2.5 DNS2.6 P2P applications2.7 socket programming with UDP and TCPApplication Layer 2-7Electro

8、nic mailThree major components: user agents mail servers simple mail transfer protocol: SMTPUser Agenta.k.a. “mail readercomposing, editing, reading mail messagese.g., Outlook, Thunderbird, iPhone mail clientoutgoing, incoming messages stored on serveruser mailboxoutgoing message queuemailservermail

9、servermailserverSMTPSMTPSMTPuseragentuseragentuseragentuseragentuseragentuseragentApplication Layer 2-8Electronic mail: mail serversmail servers:mailbox contains incoming messages for usermessage queue of outgoing (to be sent) mail messagesSMTP protocol between mail servers to send email messagescli

10、ent: sending mail server“server: receiving mail servermailservermailservermailserverSMTPSMTPSMTPuseragentuseragentuseragentuseragentuseragentuseragentApplication Layer 2-9Electronic Mail: SMTP RFC 2821vuses TCP to reliably transfer email message from client to server, port 25vdirect transfer: sendin

11、g server to receiving servervthree phases of transferhandshaking (greeting)transfer of messagesclosurevcommand/response interaction (like HTTP, FTP)commands: ASCII textresponse: status code and phrasevmessages must be in 7-bit ASCIApplication Layer 2-10useragentScenario: Alice sends message to Bob1)

12、 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 server4) SMTP client sends Alices message over the TCP connection5) Bobs mail server places the message in Bobs mailbox6) Bob

13、 invokes his user agent to read messagemailservermailserver123456Alices mail serverBobs mail serveruseragentApplication Layer 2-11Sample SMTP interaction S: 220 hamburger.edu 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: 2

14、50 bobhamburger.edu . 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 hamburger.edu closing connectionApplication Layer 2-12Try SMTP interaction for yourself:vtelnet serverna

15、me 25vsee 220 reply from serverventer HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader)Application Layer 2-13SMTP: final wordsvSMTP uses persistent connectionsvSMTP requires message (header & body) to be in 7-bit ASCIIvSMTP server uses CRLF.C

16、RLF to determine end of messagecomparison with HTTP:vHTTP: pullvSMTP: pushvboth have ASCII command/response interaction, status codesvHTTP: each object encapsulated in its own response msgvSMTP: multiple objects sent in multipart msgApplication Layer 2-14Mail message formatSMTP: protocol for exchang

17、ing 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 onlyheaderbodyblanklineApplication Layer 2-15Mail access protocolsvSMTP: delivery/storage to receivers servervmail access pr

18、otocol: 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.senders mail serverSMTPSMTPmail accessprotocolreceivers mail ser

19、ver(e.g., POP, IMAP)useragentuseragentApplication Layer 2-16POP3 protocolauthorization phasevclient commands: user: declare usernamepass: passwordvserver responses+OK-ERRtransaction phase, client:vlist: list message numbersvretr: retrieve message by numbervdele: deletevquit C: list S: 1 498 S: 2 912

20、 S: . C: retr 1 S: S: . C: dele 1 C: retr 2 S: S: . C: dele 2 C: quit S: +OK POP3 server signing offS: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged onApplication Layer 2-17POP3 (more) and IMAPmore about POP3previous example uses POP3 “download and delete mo

21、deBob cannot re-read e-mail if he changes clientPOP3 “download-and-keep: copies of messages on different clientsPOP3 is stateless across sessionsIMAPvkeeps all messages in one place: at servervallows user to organize messages in foldersvkeeps user state across sessions:names of folders and mappings between message IDs and folder name

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 医学/心理学 > 基础医学

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号