Sei sulla pagina 1di 64

Application Protocols

SMTP
Problems
Transferring mail across different networks
Use different transport services
Different domains
Appropriate messages and regular updating
mechanism
Security
E-Mail
Allows you to send messages via
computer networks to other computer
users.
The message may include a file (attachments)
You must know the e-mail address of the
recipient, just as you need to know the phone
number to use a phone.
Introduction
What is SMTP? The Internets standard
protocol used in sending and receiving e-
mail in order to transfer mail reliably and
efficiently

SMTP
Simple Mail Transfer Protocol.
The SMTP service is a modification of the
FTP
SMTP is an electronic mail routing protocol
that uses TCP/IP to route mail messages
between network hosts.
SMTP does not deal with local mail user
issues. This is handled by an e-mail tool
(Outlook Express, Netscape Messenger)
Solutions
2-way transmission channel
Server confirmation
Host and the server identify each other
Commands and Replies
Extension services
Mail could be directly delivered or could be relayed
across networks
Server takes full responsibility


Solutions

Mail object
Envelope and Content
Envelope-Originator address
- Recipient address or addresses
- Optional protocol extension material
SMTP Mail Message Format
Messages are a Human Readable Text File
Two Parts: Envelope and Contents
Envelope:
Keyword/Value Pairs
One Per Line
Common Keywords
Subject:
Date:
From:
Reply-To:
Common Mailer Generated Keywords:
Received:
Message-Id:
Message Contents
Separated From Envelope By a Blank Line
Definition :
Internet method of Transferring Electronic
Mails (Allows Message to be packed and
Delivered to remote systems
Transferring Mail Between Two Hosts
E-mail standards
Simple Mail Transfer Protocol (SMTP):
part of the TCP/IP protocol suite.
SMTP is the main e-mail standard for
mail transfer agents in use today, but
was written to only handle text files.
SMTP is usually implemented using a
two-tier client-server architecture.
Two other competing standards for e-
mail are Common Messaging Calls
(CMC) and X.400.
Simple Mail Transfer Protocol (SMTP)
Sends and receive e-mail messages
from one e-mail server to another.
Defines a dialog between a sending
and receiving system.
Two-Tier E-mail Architecture
SMTPs uses two types of programs:
User agents, aka e-mail clients, are
programs running on client computers that
send e-mail to e-mail servers and download
e-mail from mailboxes on those servers.
Examples: Eudora, Outlook.
Mail transfer agents, also called mail server
software, are used by e-mail servers, sends
e-mail through the Internet between e-mail
servers and maintains individual mailboxes.
Post Office Protocol (POP) & Internet Mail Access
Protocol (IMAP) are the main protocols for user
agent to mail server communications.

Complementary Protocols
SMTP is limited in its ability to queue
messages at the receiving end. One of
two others are used in conjunction:
POP3
IMAP4 (Internet Message Access Protocol)
Client computer with
e-mail client
software
(user agent)
Server computer with
e-mail server
software
(message transfer
agent)
SMTP packet
SMTP packet
LAN
Client computer with
e-mail client
software
(user agent)
Server computer with
e-mail server
software
(message transfer
agent)
SMTP packet
LAN
SMTP packet
IMAP or
SMTP packet
Internet
Simple Mail Transfer Protocol
SMTP E-mail messages have the
following structure:
Header: lists source and destination
addresses, date, subject and other
information about the e-mail message.
Body: the message itself
Attachments: additional files that have been
included along with the e-mail message.
Figure 2-13 Sample E-mail
Message using SMTP
From: Alan Dennis;<adennis@indiana.edu>
TO: Pat Someone <someone@somewhere.com>
Date: Mon 06 Aug 2001 19:03:02 GMT
Subject: Sample Note
Message-Id:
<4.1.20000623164823.009f5e80@IMAP.IU.EDU>
DATA:
This is an example of an e-mail message
Message
header
Message
body
How it works
Sender SMTP establishes a two-way
transmission channel to a receiver SMTP.
Once the channel is established, there are three
basic steps to SMTP mail transactions:
MAIL FROM:
RCPT TO:
DATA
At each step, the procedure can be accepted
(OK) or rejected (Failure reply)
How Mail Gets Transfer From One
Hosts to Another
SMTP defines a set of commands with strict
Syntax that are used to move mail
Messages from one hosts to another. These
Functions are not user-visible.
SMTP delivers mail by establishing a
Transmission path between an SMTP
Client (Sender-SMTP)
SMTP Commands
HELO - identifies sender
MAIL FROM: - starts a mail transaction and
identifies the mail originator
RCPT TO: - identifies individual recipient. There
may be multiple RCPT TO: commands.
DATA - sender ready to transmit a series of lines of
text, each ends with \r\n. A line containing only a
period . indicates the end of the data.
SMPT example


>MAIL FROM:
<marcoa@ieee.org>
>250 Mail.mydomain.com
MYPC
>HELO MYPC
>250 OK
>RCPT TO:
<jeboritz@uwaterloo.ca>
>250 OK
>DATA
>354 Start mail input, end
with <CRLF>.<CRLF>.
>Hello Efrim <CRLF>.<CRLF>.
>250 OK
>QUIT
>221 Goodbye MYPC
Simple Mail Transfer Protocol (SMTP)
Attachments in MIME
Because SMTP was developed for transferring text files, a
special techniques needed to be developed to send
graphical information.
Graphics capable mail transfer agent protocols include
MIME (Multipurpose Internet Mail Extension), uuencode
and binhex.
Included as part of an e-mail client, MIME translates
graphical information into text allowing the graphic to be
sent as part of an SMTP message.
The receivers e-mail client then translates the MIME
attachment from text back into graphical format.
Encoding: Header Information
MIME Multipurpose Internet Mail Extensions
Mime Format in Mail Header Identifies the Contents
MIME Body Types
Text
Plain No Encoding Needed
RTF Allows Some Formatting
Image
Audio
Application
A Specific Application Format (e.g. Microsoft Word)
Structured
Allows Multiple Types in One Document
Message
Used To Identify Partial Messages
Encoding Techniques (2)
Non-Portable Formats
Will Cause Corruption if an Intermediate Server Has
Limitations
Eight-Bit
No Encoding
No Line Exceeds 1000 Characters
Binary
No Encoding
Lines May Be Too Long
Retrieving Mail
Offline Model
User Doesnt Have to Be Connected In Order to
Receive Messages
Mail Server Stores Messages For a User Locally
User Then Downloads Them To a Local File
POP Post Office Protocol
Uses Port 110
Current Version: POP3 (Version 3)
Allows Selective Downloading
Session Based:
Authorization
User Name, Password
Transaction
STAT Request Statistics (Number of Messages, Size)
LIST List of Messages With Size
RETR Download a Message
DELE Delete Message From Server
QUIT End Session
SENDMAIL
Client
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
SENDMAIL
Client
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
Host A
Host B
Messages
Physical Network
File Transfer Protocol (FTP) and
Telnet
FTP enables sending and receiving files
over the Internet.
Telnet allows remote logins over the
Internet.
Both were much more commonly used
during the pre-WWW days of the
Internet.
FTP still commonly used today for
uploading web pages.
E-mail Models
Online
Email resides on the server, access to email
(including reading etc.) requires connection to server.
Offline
Mail is retrieved from server during connection, and
stored on client.
Disconnected
Mail is retrieved and manipulated on-line when
connected, cached on the local machine when off-
line, and syncronized when connected again.
File Transfer Protocol (FTP)
Protocol that allows transfer of files across
Internet
Both computers need to run FTP - one acts
as a server (remote), the other as a client
(local)
Many shareware files available
Often stored in ZIP format or self-extracting
EXE
Disadvantage - must know name of file
FTP
The File Transfer Protocol allows files to
be moved from one machine to another.
FTP is client-Server based where the
server acts as a store for files. Clients may
connect and request files on the server
FTP is becoming less popular with
changes that have been made in HTTP.
How to FTP
Steps to FTP:
1. Log on to machine e.g. to csusap
2. Connect to a another remote machine by either:
i. anonymous FTP - very common - but can
only access files in the pub directory
Login: anonymous
Password: <your email address>
ii. log in as yourself - this requires you to have
an account on that machine i.e. username
and password Gives you access to files that
you own on that machine.
Pictorial representation of FTP
Computer
A
Computer
B
file1.txt
file2.txt
put file2.txt
get file1.txt
Computer B
establishes an FTP
session with Computer A
and issues the get and
put statement
Both Computer A and Computer B
have FTP running
Transferring Files Between Hosts
The File Transfer (ftp) commands is used to
Transfer files between hosts of possibly
Dissimilar file system.
FTP establishes two connection between
The client and the server
One for control information such as
Commands and responses,
And a second for transferring data
Which FTP Program
A number available:
WinQVT - traditionally used on Windows 3.1
Unix ftp - activated through Start, Run, ftp
CuteFTP - excellent, windows based, easy to use
WS_FTP - on most CSU machines (CSU
Applications)
Tucows - excellent repository for FTP programs:
Web browser - e.g. Netscape/Explorer can 'get'
files.
How to Uses the ftp commands
Transferring and managing
Changing and listing contents of Directories
Managing which files will be transferred
Managing connections with remote hosts


Basic FTP commands (Unix)
ftp> open csusap.csu.edu.au - establishes FTP session ftp>
user ausernam login as "ausernam"
ftp> ls -l - equivalent to dir on remote machine
ftp> cd ... - changes to new directory on remote machine
ftp> lcd ... - changes to new directory on local machine
ftp> lcd ... - changes to new directory on local machine
ftp> get filename - gets filename from remote machine
ftp> put filename - puts filename on remote machine
ftp> quit - terminates FTP session.

FTP Objectives

promote sharing of files
encourage indirect use of remote computers
shield user from variations in file storage
transfer data reliably and efficiently
FTP, although usable directly by a user at a
terminal, is designed mainly for use by
programs
Control and Data Connections
Control functions (commands) and reply
codes are transferred over the control
connection.
All data transfer takes place over the data
connection.
The control connection must be up while
data transfer takes place.
How the ftp server function
Ftp commands and replies are exchanged
Through one connection, while
Data is transferred over a separate
Connection
The FTP client communicates with the
FTP server on the remote host using TCP
Standard Connection Model
Control
Data
A
B
FTP Client/Server interaction
FTP
Control
FTP
Transfer
FTP
Control
FTP
Transfer
FTP Client
User
FTP Client
User
Commands
Replies
Data
Data
FTP
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
FTP
Server
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
Host A
Host B
Messages
Physical Network
The TELNET Protocol
Telnet Protocol
Telnet - complex protocol that allows one
machine to log into another on the Internet
Stilled based on TCP/IP
Why have a telnet session?
Local machine can access remote computer
hardware
Reduces organisations hardware costs.
TELNET
This protocol enables users to log on to
other machines remotely.
Essentially their terminal becomes the
equivalent of the dumb terminal of mainframe
systems, allowing the user to run programs as
if they were physically sitting at the machine.
Normally requires a username and password
Telnet Uses the client-server model
TELNET vs. telnet
TELNET is a protocol that provides a
general bi-directional, eight-bit byte
oriented communications facility.
telnet is a program that supports the
TELNET protocol over TCP.
Many application protocols are built
upon the TELNET protocol.
The TELNET Protocol
TCP connection
data and control over the same
connection.
Network Virtual Terminal
negotiated options
Network Virtual Terminal (NVT)
The Network virtual Terminal (NVT) is an
Imaginary device that is used as a model for
Real terminals.
The NVT is a bidirectional, character-based
Device with a printer and a keyboard
Pictorial representation of Telnet
Computer
A
Computer
B
Software
Data
Computer B
establishes a Telnet
session with Computer A
and can now access
programs and resources
on Computer A
Both Computer A and Computer B
have Telnet running
Network Virtual Terminal
intermediate representation of a generic
terminal.
provides a standard language for
communication of terminal control
functions.
Network Virtual Terminal
NVT
NVT
Server
Process
TCP
TCP
Negotiated Options
All NVTs support a minimal set of
capabilities.
Some terminals have more capabilities
than the minimal set.
The 2 endpoints negotiate a set of
mutually acceptable options (character
set, echo mode, etc).
Connecting to Remote Host
Telnet
The telnet command provides remote login
Services so that an interactive user on a
Client system can connect with a server on
A remote system
The telnet command uses TCP as the
Protocol to ensure error checking.
The telnet command establishes a
Connection with a remote host, it maps the
Local terminal into a model of a terminal
Called a Network Virtual Terminal (NVT)
Negotiated Options
The protocol for requesting optional
features is well defined and includes rules
for eliminating possible negotiation loops.
The set of options is not part of the
TELNET protocol, so that new terminal
features can be incorporated without
changing the TELNET protocol.
How to use the telnet command
Entering the telnet command in its simplest
Form
telnet
Will start the telnet process, and the prompt
telnet>
To start a login session with a host, enter
The telnet command in the form
telnet Host

Option examples
Line mode vs. character mode
echo modes
character set (EBCDIC vs. ASCII)
Telnet send command arguments
Service Required Send Argument
Break or kill brk
Erase character ec
Erase line el
Interrupt process ip
Go Ahead ga
No operation nop
How the telnet server Functions
The telnet commands uses the TCP and IP
Protocol to establish communication with
Remote server
TELNET
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
TELNET
Server
Transport Control
Protocol
Internet Protocol
Network Interface
Protocol
Host A
Host B
Messages
Physical Network
World Wide Web (WWW)
A protocol that uses hypertext links
Accessed by using a browser
Uniform Resource Locator (URL) - a specific
address to a particular resource
protocol://host/directory/resource
Examples
http://csu.edu.au/images/csu.gif
ftp://ftp.monash.edu.au/pub/win95/update.txt
telnet://lorenz.mur.csu.edu.au
news:aus:computing
Thank You