

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















2: Application Layer 4
»transfer file to/from remote host »client/server model » client: side that initiates transfer (either to/from remote) » server: remote host »ftp: RFC 959 »ftp server: port 21
file transfer (^) FTP server
FTP user interface
FTP client
local file system
remote file system
user at host
2: Application Layer 5
FTP: SEPARATE CONTROL, DATA CONNECTIONS
»FTP client contacts FTP server at port 21, specifying TCP as transport protocol
»Client obtains authorization over control connection
»Client browses remote directory by sending commands over control connection.
»When server receives a command for a file transfer, the server opens a TCP data connection to client
»After transferring one file, server closes connection.
client
server
TCP control connection port 21
TCP data connection port 20
Server opens a second TCP data connection to transfer another file. Control connection: “out of band” FTP server maintains “state”: current directory, earlier authentication
% ftp nordsieck.cs.colorado.edu Connected to nordsieck.cs.colorado.edu. 220 nordsieck FTP server (Version 5.53 Tue Aug 25 10:46:12 MDT 1992) ready. Name (nordsieck.cs.colorado.edu:yourlogin): yourlogin 331 Password required for yourlogin. Password: 230 User yourlogin logged in. ftp> cd HPSC/exercises 250 CWD command successful. ftp> ls 200 PORT command successful. 550 No files found. ftp> put tmul.out 200 PORT command successful. 150 Opening ASCII mode data connection for tmul.out. 226 Transfer complete. local: tmul.out remote: tmul.out 1882 bytes sent in 0.0095 seconds (1.9e+02 Kbytes/s) ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. tmul.out 226 Transfer complete. 9 bytes received in 0.0021 seconds (4.3 Kbytes/s) ftp> mput * mput Makefile? y 200 PORT command successful. 150 Opening ASCII mode data connection for Makefile. 226 Transfer complete. local: Makefile remote: Makefile 1020 bytes sent in 0.0062 seconds (1.6e+02 Kbytes/s) mput tmul.out? n ftp> quit 221 Goodbye.
C:>ftp 127.0.0. Connected to 127.0.0.1. 220-FileZilla Server version 0.9.33 beta 220-written by Tim Kosse ([email protected]) 220 Please visit http://sourceforge.net/projects/filezilla/ User (127.0.0.1:(none)): nauman 331 Password required for nauman Password: 230 Logged on ftp> dir 200 Port command successful 150 Opening data channel for directory list. drwxr-xr-x 1 ftp ftp 0 Nov 11 15:19 admins drwxr-xr-x 1 ftp ftp 0 Nov 11 15:20 mail archives drwxr-xr-x 1 ftp ftp 0 Nov 11 15:19 passwords drwxr-xr-x 1 ftp ftp 0 Nov 11 15:19 staff drwxr-xr-x 1 ftp ftp 0 Nov 11 15:25 users 226 Transfer OK ftp: 293 bytes received in 0.00Seconds 293000.00Kbytes/sec. ftp> bye 221 Goodbye C:>
Mail Servers System that provides mail boxes Mail Sender and Receiver Users that connects to mail servers for their emails Users that have the capability to connect to mail servers, generate emails for servers and read mails from inboxes Mail Protocol Language used between users and mail servers Transport Service Mail Users and servers are connected to some transport service There can be single or multiple transport services between mail sender and receiver Mail Relay Servers When mail sender and receiver are not on the same mail servers there can be intermediate mail servers termed as relay servers
User Agent mail server
SMTP
User Agent
User Agent SMTP
Intermediate Servers Or Relay Servers
SMTP
SMTP
Client Side implementation of SMTP
2: Application Layer 13
»mailbox contains incoming messages for user
»message queue of outgoing (to be sent) mail messages
»SMTP protocol between mail servers to send email messages
» client: sending mail server » “server”: receiving mail server
user agent
mail server
user agent
user agent
user agent mail server
user agent user agent
mail server
SMTP
SMTP
SMTP
2: Application Layer 14
»uses TCP to reliably transfer email message from client to server, port 25
»direct transfer: sending server to receiving server
»three phases of transfer
» handshaking (greeting) » transfer of messages » closure
»command/response interaction
» commands: ASCII text » response: status code and phrase
»messages must be in 7-bit ASCII
2: Application Layer 16
S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 [email protected]... Sender ok C: RCPT TO: S: 250 [email protected] ... 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
2: Application Layer 19
Docsity.com
2: Application Layer 20
»SMTP uses persistent connections
»SMTP requires message (header & body) to be in 7-bit ASCII
»SMTP server uses CRLF.CRLF to determine end of message
Comparison with HTTP:
»HTTP: pull »SMTP: push
»both have ASCII command/response interaction, status codes
»HTTP: each object encapsulated in its own response msg »SMTP: multiple objects sent in multipart msg