5.
Application Layer
(Part-1)
POP3 ,SMTP
1]POP3 Protocol
A]Features -
• POP stands for Post Office Protocol.
• The POP protocol was published in the year 1984.
• POP has been updated two times namely “POP2” and “POP3”.
• The POP protocol is application layer protocol.
• It is pull protocol
• The need for POP mainly arises when the user or client does not have a
continuous internet connection .
• POP3 client is installed on the receiver’s system while the POP3 server is
installed on the receiver's mail server.
• POP3 protocol is used to provide access to the mail inbox that is stored in
the email server.
• POP3 protocol can download and delete emails.
• Once the POP3 client has established a connection with the mail server it
can easily retrieve all the emails from the server.
B] Working-
1. Initially, POP3 needs to establish a connection between the POP client
and the POP server
2. The POP3 server asks for the user name to the POP3 client. If the
username is found in the POP3 server, then it sends the ok message.
3. Then POP3 server asks for the password from the POP3 client; then the
POP3 client sends the password to the POP3 server. If the password is
matched, then the POP3 server sends the OK message, and the
connection gets established.
4. After the establishment of a connection, the client requests available
email messages(Email-List).
5. The Server sends the available email list along with their size and unique
identifier number.
6. Once the client receives the list, it makes a request to the server for
downloading the emails. The user marks such emails and sends them to
the server.
7. On receiving list from client , server sends the emails selected by the
client and accordingly marks them as read or unread.
8. a) In delete mode, Client can send a request for deleting the emails , in
this mode emails are deleted from mailbox after retrieval.
b) In keep mode , mails remains in the mail box after retrieval.
9. Once the tasks are completed the client sends a close connection request
to the server
10. The server then sends an acknowledgment to the client and closes the
connection.
C] Advantages of POP3
• It allows the users to read the email offline. It requires an internet
connection only at the time of downloading emails from the server.
• POP3 protocol does not require permanent internet connectivity.
• It provides easy and fast access to the emails as they are already stored on
our local system.
• There is no limit on the size of the email which we receive or send.
• It is a simple protocol so it is one of the most popular protocols used today.
• It is easy to configure and use.
D] Disadvantages of POP3
• POP3 does not provide the feature of real-time synchronization.
• If an email consists of virus attachments it can affect the local system easily.
• POP3 does not support accessing the same email at the same time on
different systems.
• Transferring the mail folder from the local machine to another machine can
be difficult.
• The email folder which is downloaded from the mail server can also become
corrupted.
2] SMTP
A] Features -
• SMTP stands for Simple Mail Transfer Protocol.
• SMTP is a application layer protocol.
• It is push protocol used to transfer mail .
• The client who wants to send the mail opens a TCP connection to the
SMTP server and then sends the mail across the connection.
• The SMTP server is an always-on listening mode. As soon as it listens for a
TCP connection from any client, the SMTP process initiates a connection
through port 25.
• After successfully establishing a TCP connection the client process sends
the mail instantly.
• SMTP is a set of communication guidelines that allow software to transmit
an electronic mail over the network.
B] Components Of SMTP
• SMTP client and SMTP server has two main components such as user
agent (UA) and mail transfer agent (MTA).
A]User Agent (UA)-
• It prepares the message, creates the envelope and then puts the
message in the envelope.
• It helps in sending and retrieving mail. It is responsible for creating email
messages
B]Mail transfer agent (MTA) –
• It transfer the mail from one system to another.
• To send mail , a system must have client MTA
• To receive mail, system must have server MTA
C] Working of SMTP
1.Communication between the sender and the receiver :
• The sender’s user agent(UA) prepares the message and sends it to the
MTA.
• It is a MTA’s responsibility to transfer the mail across the network to the
receiver’s MTA.
• To send mail, a system must have a client MTA, and to receive mail, a
system must have a server MTA.
2. Sending Emails:
• Mail is sent by a series of request and response messages between
the client and the server.
• The message which is sent ,consists of a header and a body.
• A null line is used to terminate the mail header and everything after the
null line is considered the body of the message, which is a sequence of
ASCII characters.
• The message body contains the actual information read by the receipt.
3. Receiving Emails:
• The user agent on the server-side checks the mailboxes at a particular
time of intervals.
• If any information is received, it informs the user about the mail.
• When the user tries to read the mail it displays a list of emails with a short
description of each mail in the mailbox.
• By selecting any of the mail users can view its contents on the terminal.
D] SMTP Commands
• HELO – Identifies the client to the server, only sent once per session ,
provides identification of sender.
• MAIL – Initiate a message transfer, it specifies originator of mail.
• RCPT – specifies an address of receiver, and for multiple addressees use
one RCPT for each address.
• DATA – specifies the beginning of mail ,sends data line by line
• QUIT- closes TCP connection
SMTP Command Example