cp476 internet computing lecture 4: smtp, ftp and telnet 1 lecture 4. smtp, telnet, and ftp...

10
CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail Transfer Protocol (SMTP) Telnet (a remote log in) protocol File Transfer Protocol Simple Mail Transfer Protocol (SMTP) SMTP defines a mechanism for electronic mail based on TCP/IP. It supports Sending a single message to one or more recipients identified by email address. Sending messages that include text, voice, video, ore graphics. Sending message outside the Internet. SMTP mechanism A human user uses a user agent (UA) to prepare the message contains header and body Creating the envelope containing the sender’s address, receiver’s address, and other information

Upload: baldric-booth

Post on 28-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1

Lecture 4. SMTP, TELNET, and FTP

Objective: to know the underlying principles of

• Simple Mail Transfer Protocol (SMTP)• Telnet (a remote log in) protocol • File Transfer Protocol

Simple Mail Transfer Protocol (SMTP)

• SMTP defines a mechanism for electronic mail based on TCP/IP. It supports

– Sending a single message to one or more recipients identified by email address.

– Sending messages that include text, voice, video, ore graphics. Sending message outside the Internet.

• SMTP mechanism

– A human user uses a user agent (UA) to prepare the message contains header and body

– Creating the envelope containing the sender’s address, receiver’s address, and other information

Page 2: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 2

mailboxesspool

Alias exp.database

UA

Interface

MTAClient

MTAServer

User A

mailboxesspool

Alias exp. database

UA

Interface

MTAClient

MTAServer

User B

– The Message Transfer Agent (MTA) transfers the mail across the Internet, from MTA client to MTA server.

– The user agent periodically checks the mailbox.

TCP/IP/Data Link

Page 3: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 3

• Email address

– local part@domain nameThe local part define the name of a mailbox, a file storing all incoming mail for a user, can be retrieved by the UA.

– The domain name is the domain name of the MTA server.

• Delay: stored in a spool on either side, intermediate delay.

• Aliases: one-to-many, many-to-one

• SMTP uses commands and responses to transfer messages between an MTA client and an MTA server

Page 4: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 4

• Commands by MTA client

HELLO:hfan.wlu.caMAIL FROM: [email protected] TO: [email protected] followed by the actual dataQUIT, RESET, HELP, VRFY, NOOP, SEND FROM, etc.

• Responses by MTA server A three-digit code: 214 Help message, 220 Service ready, 221 Close channel250 OK354 Start mail input, 421 Service is not available450 Mail box is not available, etc.

• Mail transfer phases:Steps: 1. connection establishment,

MTA Client (MC) makes a TCP connection to port 25MTA sever (MS) responses 220 (service ready), MC: send command HELLO:hfan.wlu.ca, MS responses 250 (OK).

Page 5: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 5

Step 2. mail transfer: after connection between MTA client and MTA server. An eight step message transfer is connected.

MC: MAIL FROM:[email protected]: 250MC: RCPT TO:[email protected]: 250MC: DATAMS: 354MC: From: To: Date: Subject: space line ….. Dear: the contents of the email

. MS: 250

Step 3. connection termination MC: QUITMS: 221

• Multipurpose Internet Mail Extension (MIME) is an extension of SMTP that allow the transfer of multimedia message.

Page 6: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 6

• Mail access protocols

– POP (Post Office Protocol) The client open opens a connection with serveron TCP port 110. It then sends its user name and password to access the mailbox.

POP client (PC) communicates with POP server (PS)UC: user namePS: OKUC: passwordPS: OKUC: listPS: the number of emails and their sizesPC: retrieve 1PS: email 1…………..PC: retrieve NPS: email N

– IMAP1. Client can check the email header2. Search the email for a special string3. Partially download an email4. Can create, delete or rename mailbox on server side5. Can create a hierarchy of mailbox.

Page 7: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 7

TELNET

• Define a mechanism for users to log on to a remote machine using TCP/IP.

• TELNET uses one TCP connection. Server uses port 23 and client uses an ephemeral port. The same connection is used for both control commands and data. This is accomplished by embedding the control characters in a data stream.

• A terminal driver interprets the keystrokes on the local terminal or terminal emulator.

Terminaldriver

TCPIP

Data linkPhysical

Telnet clientTerminal

Terminaldriver

TCPIP

Data linkPhysical

Telnet serverApplicationprograms

Internet

OSOS

NVT character set

Local character set Remote character set

Page 8: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 8

• Control Characters

– Telnet use the Network Virtual Terminal (NVT) system to encode characters on the local system.

– On the server machine, NVT decodes the characters to a form acceptable to the remote machine.

– NVT uses an 8-bit character set in which the highest order bit is set to be one. EOF = 236 = 111011100 end of fileEOR = 239 end of recordIAC = 255 = Interpreted as Control, etc.

• A set of characters for remote control, control characters are embedded in the data stream and preceded by the interpreter IAC.

• OptionsBinary, echo, suppress go-head, status, timing mark, terminal type, terminal speed, line mode

Page 9: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 9

File Transfer Protocol (FTP)

• FTP defines a mechanism for copying a file from one host to another using TCP/IP

• FTP requires two connections for data transfer

– A control connection on port 21 (server side)

– A data connection on port 20 (server side)

• Control

1. The server issues a passive open

2. The client uses a ephemeral port and issues an active open

• Data connection:

1. The client issues a passive open using ephemeral port.

2. Client sends this port number to the server using PORT command,

3. the server receives the port number and issues an active open using the port 20.

• Communication over control connection uses NVT ASCII. File type: ASCII, Binary. Trans. Mode: stream, block, and compressed mode.

Page 10: CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 1 Lecture 4. SMTP, TELNET, and FTP Objective: to know the underlying principles of Simple Mail

CP476 Internet Computing Lecture 4: SMTP, FTP and TELNET 10

– Prior to the actual transfer of files, the file type, data structure, and transmission mode are defined by the client through control connection.

– There are six classes of commands sent by the client to establish communication with the sever:

1. Access commands: USER, PASS, ACCT, QUIT, etc

2. File management commands:CWD ( directory name, DELE (file name), RNTO (rename), etc.

3. Data formatting commands,

4. port defining commands,

5. file transfer commands,

6. Mis. Commands.

– Responses are sent from the server to the client during connection establishment. Three digits code.

• There are three types of file transfer

– A file is copied from server to client

– A file is copied from client to sever

– A list of directories or filenames is sent from server to client.