<<

UNIT V

Traditional applications -Electronic Mail (SMTP, POP3, IMAP, MIME) – HTTP – Web Services – DNS- DDNS - - Protocol– SNMP-Cryptography - Basic concepts.

5.1 TRADITIONAL APPLICATIONS  These applications use the request/Reply paradigm  The request paradigm is used by user to send a request to  The response paradigm is used by server to send a reply based on request  Applications are  Remote Logging(TELNET)  E-Mail  File Transfer  WWW  Web Services  SNMP  HTTP

5.2 ELECTRONIC MAIL (SMTP, POP3, IMAP, MIME) E-mail is one of the most popular services than it was when it was envisaged.

Common Architecture

The following shows components of e-mail system involved in Alice sending a message to Bob

Components

1. User Agent 2. Message 3. Message Transfer Agent 4. Message Access Agent

User Agent

A user agent (UA) is software that is either command (eg. pine, elm) or GUI based (eg. Microsoft Outlook, ). It facilitates: o Composing messages UA helps to compose messages by providing a template that comes with a built-in editor.

SNSCT/ NETWORKS Page 1

o Reading messages UA checks mail in the incoming box and apart from message provides information such as sender, size, subject and flag (read, new). o Replying to messages UA allows user to reply (send message) back to sender o Forwarding messages UA facilitates forwarding message to a third party. o Handling mailboxes UA creates two mailboxes for each user, namely inbox (to store received ) and outbox (to keep all sent mails).

Message Format

RFC822 defines message to have two parts namely header and a body. The message header is a series of terminated lines. Each header line contains a type and value separated by a (:). It is filled by the user/system. Some of them are: o From user who sent the message o To identifies the message recipient(s). o Subject says something about the purpose of the message o Date when the message was transmitted o E-mail address consists of user_name@domain_name where domain_name is hostname of the mail server. The body of the message contains the actual information o The header is separated from the message body by a blank line. Initially system was designed to send messages only in NVT 7-bit ASCII format. o Languages such as French, German, Chinese, Japanese were not supported. o Image, audio and video files cannot be sent.

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 to NVT ASCII and delivers to client MTA. The NVT ASCII data is converted back to non-ASCII form at the recipient mail server. MIME defines five headers. They are: specifies the current version 1.1 o MIME-Version o Content-Type specifies message type such as text (plain, html), image (jpeg, gif), audio, video and application (postscript, msword). If more than one type exists, then it is termed as multipart (mixed). o Content-Transfer-Encoding defines how data in the message body is encoded such as binary, base64, 7-bit, etc. o Content-Id unique identifier the whole message in a multiple message type. o Content-Description describes type of the message body.

For example, a message containing plain text and an image file looks like:

MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------417CA6E2DE4ABCAFBC5" From: Alice Smith To: [email protected] Subject: promised material Date: Mon, 07 Sep 1998 19:45:19 -0400 ------417CA6E2DE4ABCAFBC5 Content- Type: text/plain; charset=us-

SNSCT/COMPUTER NETWORKS Page 2

Content-Transfer-Encoding: 7bit Bob, Here's the jpeg image and draft report I promised. --Alice ------417CA6E2DE4ABCAFBC5 Content-Type: image/jpeg Content- Transfer-Encoding: base64 . . . unreadable encoding of a jpeg figure

Message Transfer Agent (MTA): SMTP

Message Transfer Agent (MTA) is a mail daemon (a version of sendmail program) that helps to transmit/receive message over the network. To send mail a system must have the client MTA, and to receive mail a system must have a server MTA.

Simple Mail Transfer Protocol (SMTP) defines communication between client/server MTA. SMTP defines how commands and responses must be sent back and forth.

Some commands sent from client MTA are:

Command Description HELO Sender's host name MAIL FROM Sender of the message RCPTTO Recipient of the message DATA Body of the mail QUIT Terminate VRFY Name of recipient to be verified before forwarding EXPN Mailing list to be expanded

Common responses sent from server MTA are:

Code Description 220 Service ready 221 Service closing transmission channel 250 Request completed 354 Start mail input 450 Mailbox not available 500 Syntax error; unrecognized command 550 Command not executed, mailbox unavailable 551 User not local

SMTP uses TCP connection on port 25 to forward the entire message and store at intermediate mail servers/mail gateways until it reaches the recipient mail server.

SNSCT/COMPUTER NETWORKS Page 3

The following example shows commands and responses using SMTP protocol

HELO cs.princeton.edu 250 Hello [email protected] [128.12.169.24] MAIL FROM: 250 OK RCPT TO: 250 OK RCPT TO: 550 No such user here DATA 354 Start mail input; end with . Blah blah blah...... etc. etc. etc. . 250 OK QUIT 221 Closing connection

In each exchange, the client posts a command and the server responds with a code. The server also returns a human-readable explanation for the code. After the commands and responses, client sends the message which is ended by a period (.) and terminates the connection. Message Access Agent (MAA)/Mail Reader: POP and IMAP

MAA or mail reader allows user to retrieve messages from the mailbox, so that user can perform actions such as reply, forwarding, etc. The two message access protocols are: o , version 3 (POP3) o Internet Mail Access Protocol, version 4 (IMAP4) SMTP is a push type protocol whereas POP3 and IMAP4 are pop type protocol.

The protocols involved in e-mail are shown below.

POP3

POP3 is simple and limited in functionality POP3 client is installed on the recipient computer and POP3 server on the mail server. The client opens a connection to the server on TCP port 110. The client sends username and password to access the mailbox and retrieve the messages. POP3 works in two modes namely, delete and keep mode. o In delete mode, mail is deleted from the mailbox after retrieval o In keep mode, mail after reading is kept in mailbox for later retrieval.

SNSCT/COMPUTER NETWORKS Page 4