Download presentation
Presentation is loading. Please wait.
Published byRichard Bradley Modified over 9 years ago
1
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application Layer Part 2: Client Server - FTP & Email
2
File Transfer Protocol (FTP) Electronic Mail Application Simple Mail Transfer Protocol Mail Access Protocols (POP3, IMAP) Overview 2
3
Learning Outcomes 1 To describe the FTP protocol 2 To differentiate between in-band and out of band protocols 3 To explain the different components and protocols incorporated in e-mail application 4 To define the role of the SMTP Protocol 5 To describe the main architecture of the email application 6 To compare between push and pull protocols and define the role of POP3 & IMAP Protocols 3
4
File Transfer Protocol (FTP) Electronic Mail Application Simple Mail Transfer Protocol Mail Access Protocols (POP3, IMAP) Overview 4
5
Transfer file to/from remote host Client/server model Client: side that initiates transfer (either to/from remote) Server: remote host FTP: RFC 959RFC 959 FTP server: port 21 FTP: The File Transfer Protocol file transfer FTP server FTP user interface FTP client local file system remote file system user at host File Transfer Protocol (FTP) 5
6
FTP: Separate control, Data connections FTP client contacts FTP server at port 21, using TCP Client authorized over control connection Client browses remote directory, sends commands over control connection When server receives file transfer command, server opens 2nd TCP data connection (for file) to client Server opens another TCP data connection to transfer another file Control connection: “out of band” After transferring one file, server closes data connection FTP server maintains “state”: current directory, earlier authentication File Transfer Protocol – How FTP Works? FTP client FTP server TCP control connection, server port 21 TCP data connection, server port 20 6
7
FTP Commands, Responses Sample commands: Sent as ASCII text over control channel USER username PASS password LIST: return list of file in current directory RETR filename: retrieves (gets) file STOR filename: stores (puts) file onto remote host Sample return codes Status code and phrase (as in HTTP) 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file File Transfer Protocol - Commands, Responses 7
8
File Transfer Protocol (FTP) Electronic Mail Application Simple Mail Transfer Protocol Mail Access Protocols (POP3, IMAP) Overview 8
9
Three major components: User agents Mail servers Simple mail transfer protocol: SMTP 1. User Agent A.K.A. “Mail reader” Composing, editing, reading mail messages E.G., Outlook, thunderbird, iphone mail client Outgoing, incoming messages stored on server Electronic Mail Electronic Mail Application user mailbox outgoing message queue mail server mail server mail server SMTP user agent user agent user agent 9
10
2. Mail servers: which consists of: Mailbox contains incoming messages for user Message queue of outgoing (to be sent) mail messages 3. SMTP protocol between mail servers to send email messages Client: sending mail server “Server”: receiving mail server Electronic Mail Electronic Mail Application mail server mail server mail server SMTP user agent user agent user agent user agent user agent 10
11
File Transfer Protocol (FTP) Electronic Mail Application Simple Mail Transfer Protocol Mail Access Protocols (POP3, IMAP) Overview 11
12
Electronic Mail: SMTP [RFC 2821]RFC 2821 Uses TCP to reliably transfer email message from client to server, port 25 Direct transfer: sending server to receiving server Three phases of transfer: 1. Handshaking (greeting) 2. Transfer of messages 3. Closure Command/response interaction (like HTTP, FTP) Commands: ASCII text Response: status code and phrase Messages (header + body) must be in 7-bit ASCII Simple Mail Transfer Protocol 12
13
Scenario: Alice Sends Message To Bob 1)Alice uses UA to compose message “to” bob@someschool.edubob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) client side of SMTP opens TCP connection with Bob’s mail server Simple Mail Transfer Protocol 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message user agent mail server mail server 1 2 3 4 5 6 Alice’s mail server Bob’s mail server user agent 13
14
S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 alice@crepes.fr... Sender ok C: RCPT TO: S: 250 bob@hamburger.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 connection Sample SMTP Interaction Simple Mail Transfer Protocol - Interaction 14
15
SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: 1.Header lines: Some required and optional keywords followed by collen, e.g. To: From: Subject: different from SMTP MAIL FROM, RCPT TO: commands! 2.Body: the “message” ASCII characters only Mail Message Format Simple Mail Transfer Protocol – Mail Message Format header body blank line 15
16
HTTP and SMTP Similarities and Differences SimilarityDifferences Both have ASCII command/response interaction, status codes HTTP: pull SMTP: push SMTP requires the body to be encoded into 7-bit ASCII. HTTP does not impose this restriction SMTP uses persistent connections like the case in persistent HTTP. HTTP: each object encapsulated in its own response message SMTP: multiple objects sent in multipart message SMTP server uses CRLF.CRLF to determine end of message 16
17
File Transfer Protocol (FTP) Electronic Mail Application Simple Mail Transfer Protocol Mail Access Protocols (POP3, IMAP) Overview 17
18
Mail Access Protocols Protocol to transfer email message from client to server,delivery/storage to receiver’s server SMTP Mail Access Protocol : retrieval from server POP: Post Office Protocol [RFC 1939]: authorization, download IMAP: Internet Mail Access Protocol [RFC 1730]: more features, including manipulation of stored messages on server HTTP: gmail, Hotmail, Yahoo! Mail, etc. sender’s mail server SMTP mail access protocol receiver’s mail server (e.g., POP, IMAP ) user agent user agent Mail Access Protocols 18
19
POP3 Protocol POP3 progresses through three phases: 1.Authorization, 2.Transaction 3.Update Mail Access Protocols - POP3 19
20
POP3 Protocol 1- Authorization phase Client commands: user username pass password Server responses +Ok -Err S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on Mail Access Protocols - POP3 20
21
POP3 Protocol 2- Transaction phase, Client commands: List: list message numbers Retr: retrieve message by number Dele: delete Quit Server responses: +Ok -Err C: list S: 1 498 S: 2 912 S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off Mail Access Protocols - POP3 21
22
POP3 (more) 3- Update Phase: After processing the “quit” command, the POP3 server enters the phase and remove messages 1 and 2 from the mailbox Mail Access Protocols - POP3 22
23
POP3 (more) POP3 Configuration Modes: A user agernt using POP3 can be configured (by the user) to: 1-“download and delete” mode: Like in the Previous example, Bob cannot re-read e-mail if he changes client 2- “download-and-keep”mode : Keeps copies of messages on different clients POP3 is stateless across sessions POP3 does not provide any means for a user to create remote folders and assign messages to folders. Mail Access Protocols - POP3 23
24
IMAP IMAP is a mail access protocol. It has many more features than POP3, but it is also significantly more complex. Keeps all messages in one place: at server Allows user to organize messages in folders Keeps user state across sessions: Names of folders and mappings between message IDs and folder name Mail Access Protocols - IMAP 24
25
Web-Based E-mail Hotmail, Yahoo, Google. The user agent is an ordinary Web browser The user communicates with its remote mailbox via HTTP When a sender wants to send email message, the message is sent from browser to mail server over HTTP rather than SMTP. When a receiver wants to access a message in his mail box, the email message is sent from server to browser using HTTP protocol rather than POP3 or IMAP However, communications between mail servers use SMTP Mail Access Protocols - IMAP 25
26
Conclusion FTP differs from other client-server applications in that it establishes two connections between the hosts: One connection is used for data transfer, the other for control information (commands and responses). Separation of commands and data transfer makes FTP more efficient. E-mail architecture consists of three major components: 1.User Agent 2.Mail servers 3.Protocols Message Transfer Protocol: SMTP Message Access Protocol: POP and IMAP 26
27
References Computer Networking: A Top-Down Approach Featuring the Internet by James Kurose and Keith Ross, Addison Wesley, 2012 (chapter 2 )Computer Networking File Transfer Protocol(RFC959) File Transfer Protocol(RFC959) Simple Mail Transfer Protocol (RFC2821) Simple Mail Transfer Protocol (RFC2821) 27
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.