0% found this document useful (0 votes)
152 views46 pages

Unit5 - Session12 - Email and FTP

The document describes an overview of email (electronic mail) protocols and architecture. It discusses the key components of email including user agents, message transfer agents (MTAs), and message access agents (MAAs). User agents allow users to compose, read, and manage emails. MTAs use Simple Mail Transfer Protocol (SMTP) to transfer emails between servers over the internet. Multiple scenarios of email exchanges between users on the same or different systems connected by local area networks or wide area networks are reviewed. The format of emails and operations of SMTP such as commands, responses, and an example transaction are also summarized.

Uploaded by

Ankur Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views46 pages

Unit5 - Session12 - Email and FTP

The document describes an overview of email (electronic mail) protocols and architecture. It discusses the key components of email including user agents, message transfer agents (MTAs), and message access agents (MAAs). User agents allow users to compose, read, and manage emails. MTAs use Simple Mail Transfer Protocol (SMTP) to transfer emails between servers over the internet. Multiple scenarios of email exchanges between users on the same or different systems connected by local area networks or wide area networks are reviewed. The format of emails and operations of SMTP such as commands, responses, and an example transaction are also summarized.

Uploaded by

Ankur Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

18ECC303J – Computer Communication

Networks
Course Credit : 4

Theory : 9 Hours

1. Behrouz A. Fehrouzan, “Data communication & Networking”, Mc-Graw Hill, 5th


Edition Reprint, 2014.
2. Andrew S. Tanenbaum, “Computer Networks”, Pearson Education India, 5th
Edition, 2013.
3. William Stallings, “Data & Computer Communication”, Pearson Education India,
10th Edition, 2014.
Unit-5 : Application Layer
⮚ Introduction to Application Layer
⮚ Application Layer Paradigms
⮚ Client Server Interaction
⮚ Session Initiation Protocol (SIP)
⮚ Compression Techniques
⮚ Introduction to Cryptography
✔ Types, Attacks and Services
✔ DES
✔ RSA
⮚ Email, FTP, HTTP
⮚ SNMP
Objectives
✔To understand the application layer protocols
such as Email and FTP.
✔To know the various scenarios in Email
✔To understand the User agent, format of Email
✔To understand the FTP connections.
Electronic mail (Email)
✔ Electronic mail (or e-mail) allows users to exchange
messages.
✔ In an application such as HTTP or FTP, the server
program is running all the time, waiting for a request
from a client.
✔ When the request arrives, the server provides the
service.
✔ There is a request and there is a response.
✔ In the case of electronic mail, the situation is different.

✔ First, e-mail is considered a one-way transaction.


Electronic mail (Email)
✔ When Alice sends an email to Bob, she may expect a response, but this is
not a mandate.
✔ Bob may or may not respond. If he does respond, it is another one-way
transaction.
✔ Second, it is neither feasible nor logical for Bob to run a server program
and wait until someone sends an e-mail to him.
✔ Bob may turn off his computer when he is not using it.
✔ This means that the idea of client/server programming should be
implemented in another way: using some intermediate computers (servers).
✔ The users run only client programs when they want and the intermediate
servers apply the client/server paradigm.
Architecture
• To explain the architecture of e-mail, we give a common scenario.
• Another possibility is the case in which Alice or Bob is directly connected
to the corresponding mail server, in which LAN or WAN connection is not
required.
Fig: Common scenario
• In the common scenario, the sender and the receiver of the e-mail, Alice
and Bob respectively, are connected via a LAN or a WAN to two mail
servers.
• The administrator has created one mailbox for each user where the
received messages are stored.
• A mailbox is part of a server hard drive, a special file with permission
restrictions. Only the owner of the mailbox has access to it.
• The administrator has also created a queue (spool) to store messages
waiting to be sent.
• A simple e-mail from Alice to Bob takes nine different steps, as shown in
the figure. Alice and Bob use three different agents: a user agent (UA), a
message transfer agent (MTA), and a message access agent (MAA).
• When Alice needs to send a message to Bob, she runs a UA program to prepare
the message and send it to her mail server.
• The mail server at her site uses a queue (spool) to store messages waiting to be
sent.
• The message, however, needs to be sent through the Internet from Alice’s site to
Bob’s site using an MTA.
• Here two message transfer agents are needed: one client and one server.
Like most client-server programs on the Internet, the server needs to run all the
time because it does not know when a client will ask for a connection.
• The client, on the other hand, can be triggered by the system when there is a
message in the queue to be sent.
• The user agent at the Bob site allows Bob to read the received message.
• Bob later uses an MAA client to retrieve the message from an MAA server
running on the second server.
• There are two important points we need to emphasize here. First, Bob cannot
bypass the mail server and use the MTA server directly.
• To use the MTA server directly, Bob would need to run the MTA server all the
time because he does not know when a message will arrive.
• This implies that Bob must keep his computer on all the time if he is
connected to his system through a LAN.
• If he is connected through a WAN, he must keep the connection up all the
time.
• Neither of these situations is feasible today. Second, note that Bob needs
another pair of client-server programs: message access programs.
• This is because an MTA client-server program is a push program: the client
pushes the message to the server.
• Bob needs a pull program. The client needs to pull the message from the
server.
Push versus pull in electronic email
Various scenarios in Email Architecture
First scenario in electronic mail

When the sender and the receiver of an e-mail are on the same system,
we need only two user agents
Second scenario in electronic mail

When the sender and the receiver of an e-mail are on different systems, need two
UAs and a pair of MTAs (client and server).
Third scenario in electronic mail

When the sender is connected to the mail server via a LAN or a WAN, need two UAs and
two pairs of MTAs (client and server).
Fourth scenario in electronic mail

When both sender and receiver are connected to the mail server via a LAN or a WAN,
need two UAs, two pairs of MTAs (client and server), and a pair of MAAs
(client and server).
User Agent
• The first component of an electronic mail system is the user agent (UA).

• It provides service to the user to make the process of sending and


receiving a message easier.
• A user agent is a software package (program) that composes, reads,
replies to, and forwards messages.
• It also handles local mailboxes on the user computers.
• There are two types of user agents: command-driven and GUI-based.
• Command driven user agents belong to the early days of electronic mail.
They are still present as the underlying user agents.
• A command-driven user agent normally accepts a one character command
from the keyboard to perform its task.
• For example, a user can type the character r, at the command prompt, to

reply to the sender of the message, or type the character R to reply to the

sender and all recipients.

• Some examples of command driven user agents are mail, pine, and elm.

• Modern user agents are GUI-based.

• They contain graphical user interface (GUI) components that allow the

user to interact with the software by using both the keyboard and the

mouse.

• They have graphical components such as icons, menu bars, and windows

that make the services easy to access.

• Some examples of GUI-based user agents are Eudora and Outlook.


User Agent:

⮚ The first component of an electronic mail system is the user agent . It provides
service to the user to make the process of sending and receiving a message
easier.

Services of user agent


Sending Mail
• To send mail, the user, through the UA, creates mail that looks very similar
to postal mail.
• It has an envelope and a message.
• The envelope usually contains the sender address, the receiver address, and
other information.
• The message contains the header and the body.
• The header of the message defines the sender, the receiver, the subject of
the message, and some other information.
• The body of the message contains the actual information to be read by the
recipient.
Receiving mail
• The user agent is triggered by the user (or a timer).

• If a user has mail, the UA informs the user with a notice.


• If the user is ready to read the mail, a list is displayed in which each line
contains a summary of the information about a particular message in the
mailbox.
• The summary usually includes the sender mail address, the subject, and the
time the mail was sent or received.
• The user can select any of the messages and display its contents on the
screen.
Format of an e-mail
E-mail address
SMTP
Message Transfer Agent: SMTP
⮚The actual mail transfer is done through message transfer agents. To send mail, a system
must have the client MTA, and to receive mail, a system must have a server MTA.

⮚The formal protocol that defines the MTA client and server in the Internet is called the
Simple Mail Transfer Protocol (SMTP).

SMTP range
Commands and Responses
⮚ SMTP uses commands and responses to transfer messages between an MTA
client and an MTA server

Command format
Commands
Responses
Example

▪ Let us see how we can directly use SMTP to send an


e-mail and simulate the commands and responses we described in this
section. We use TELNET to log into port 25 (the well-known port for SMTP).
▪ We then use the commands directly to send an e-mail. In this example,
[email protected] is sending an e-mail to himself.
▪ The first few lines show TELNET trying to connect to the Adelphia mail
server.
▪ After connection, we can type the SMTP commands and then receive the
responses, as shown on the next slide.
▪ Note that we have added, for clarification, some comment lines, designated
by the “=” signs. These lines are not part of the e-mail procedure.
Example (continued)

Mail Transfer Phases


The process of transferring a mail message occurs in three phases: connection
establishment, mail transfer, and connection termination.

$ telnet mail.adelphia.net 25
Trying 68.168.78.100 . . .
Connected to mail.adelphia.net (68.168.78.100).
Example (continued)
Multipurpose Internet Mail Extensions (MIME)
⮚ MIME is a supplementary protocol that allows non-ASCII data to be sent through e-mail.

⮚ MIME transforms non-ASCII data at the sender site to NVT ASCII data and delivers
them to the client MTA to be sent through the Internet. The message at the receiving
side is transformed back to the original data

Figure 26.14 MIME


MIME header
Data types and subtypes in MIME
Content-transfer-encoding

Content-Transfer-Encoding This header defines the method used to encode the


messages into Os and Is for transport:
Message Access Agent: POP and IMAP
⮚ The first and the second stages of mail delivery use SMTP.

⮚ Currently two message access protocols are available: Post Office Protocol, version 3
(POP3) and Internet Mail Access Protocol, version 4 (IMAP4)

POP3 and IMAP4


The exchange of commands and responses in POP3
FILE TRANSFER PROTOCOL
• File Transfer Protocol (FTP) is the standard mechanism
provided by TCP/IP
• It copy's a file from one host to another
• Transferring files from one computer to another in networking
or internetworking environment.
• The following problems may occur while transferring the file
between two systems
– may use different file name conventions
– may have different way to represent text and data
– may have different directory structure
• All of these problems have been solved by FTP in a very
simple and elegant approach.
FILE TRANSFER PROTOCOL
• FTP differs from other client-server applications
• 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
• The control connection uses very simple rules of
communication
• We need to transfer only a line of command or a line of
response at a time
• The data connection needs more complex rules due to the
variety of data types transferred
FTP
FTP
• The above figure shows the basic model of FTP.
• The client has three components
– The user interface
– The client control process
– Client data transfer process
• The sever has two components
– The sever control process
– The server data transfer process
• The control connection is made between the control processes
• The data connection is make between the data transfer
processes
• The control connection remains connected during the entire
interactive FTP session
• The data connection is opened and then closed for each file
transferred
• It open each time commands that involve transferring files are
used and
• It closes when the file is transferred
• The two FTP connections, control and data, use different
strategies and different port numbers.
• Communication over control connection:
• It uses 7 bit ASCII character set. Communication is achieved
through command and responses.
• We send one command or response at a time.
• Each command or response is only one short line, so we need
not worry about file format or file structure.
• Each line is terminated with a two character ( carriage return
and line feed) end of line token.
• Communication over Data connection:
• File transfer occurs over the data connection under the
control of commands sent over the control connection.
• Remember that file transfer in FTP means one of three things:
• A file is to be copied from the server to the client. This is
called retrieving the file. It is done under the supervision of
the RETR command
• A file is to be copied from the client to the server. This is
called storing a file. It is done under the supervision of the
STOR command.
• A list of directory or file names is to sent from the server to
the client. This is done under the supervision of the LIST
command. FTP treats a list of directory or file names as a file.
It is sent over the data connection.
• Note:
• Client must define the type of data, structure of the data, and
the transmission mode.
• Before sending the data through the data connection , we
prepare for transmission through the control connection.
• A file is to be copied from the client to the server. This is
called storing a file. It is done under the supervision of the
STOR command.
• A list of directory or file names is to sent from the server to
the client. This is done under the supervision of the LIST
command. FTP treats a list of directory or file names as a file.
It is sent over the data connection.
• Note:
• Client must define the type of data, structure of the data, and
the transmission mode.
• Before sending the data through the data connection , we
prepare for transmission through the control connection.
TRIVIAL FILE TRANSFER PROTOCOL [TFTP]
• In some occasions we need to copy a file without any
functionalities of FTP
• For example – to download the bootstrap and configuration
files
• For this we need a protocol that quickly copies the files
• TFTP is designed for these types of file transfer
• In this software package can fit into the read only memory of
a diskless workstation
• It can be used at bootstrap time
• TFTP can read or write a file for the client
• Reading means copying a file from the server site to the client
site
• Writing means copying a file from the client site to the server
site.
Review Questions
1. When the sender and the receiver of an e-mail are on the same system,
we need _______user agents.
2. When both sender and receiver are connected to the mail server via a
LAN or a WAN, we need ____ UAs, ______ pairs of MTAs (client and
server), and _______ pair of MAAs (client and server).
3. _________ provides service to the user to make the process of sending
and receiving a message easier.
4. The format of an email consist of ______ and ______.
5. _________ is a supplementary protocol that allows non-ASCII data to be
sent through e-mail.
6. __________ defines the MTA client and server in the Internet.
7. FTP establishes __________ and __________ connection between the
host.
8. The data connection remains connected during the entire interactive FTP
session. (Yes/No).
Answers
1. Two
2. Two, two, single
3. User agent
4. Envelope and message
5. MIME
6. SMTP
7. Control and data
8. No

You might also like