0% found this document useful (0 votes)
38 views18 pages

Open (7) DC&CN Lectures-7 - HTTP and Electronic Mail - 01 Sept

The document discusses HTTP conditional GET requests and electronic mail. It describes how conditional GETs allow caches to check for updated objects from servers. It then explains the components of electronic mail including SMTP, user agents, mail servers and mailboxes. Message formats and how messages are transferred between servers are also covered.

Uploaded by

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

Open (7) DC&CN Lectures-7 - HTTP and Electronic Mail - 01 Sept

The document discusses HTTP conditional GET requests and electronic mail. It describes how conditional GETs allow caches to check for updated objects from servers. It then explains the components of electronic mail including SMTP, user agents, mail servers and mailboxes. Message formats and how messages are transferred between servers are also covered.

Uploaded by

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

CSE2029: Data Communication & Computer Networks

Lecture-7: HTTP, Electronic Mail

Faculty: Dr. Sandeep Kumar


Outline
 HTTP: Conditional GET

 Electronic Mail

 SMTP

 Message Formats

 E-mail protocols and their communicating entities

2
HTTP: Conditional GET
• Although caching can reduce user-perceived response times, it introduces a new problem—the copy
of an object residing in the cache may be stale (outdated). In other words, the object housed in the
Web server may have been modified since the copy was cached at the client.
• Fortunately, HTTP has a mechanism that allows a cache to verify that its objects are up to date. This
mechanism is called the conditional GET.
• An HTTP request message is a so-called conditional GET message if (1) the request message uses the
GET method and (2) the request message includes an If-Modified-Since: header line.
To illustrate how the conditional GET operates, let’s walk through an example.
• First, on the behalf of a requesting browser, a proxy cache sends a request message to a Web server:

3
HTTP: Conditional GET
• Second, the Web server sends a response message with the requested object to the
cache:

• The cache forwards the object to the requesting browser but also caches the object
locally. Importantly, the cache also stores the last-modified date along with the
object.
4
HTTP: Conditional GET
• Third, one month later, the browser requests the same object via the cache, and the object is still in
the cache. Since this object may have been modified at the Web server in the past week, the cache
performs an up-to-date check by issuing a conditional GET. Specifically, the cache sends:

• Note that the value of the If-modified-since: header line is exactly equal to the value of the Last-
Modified: header line that was sent by the server one month ago. This conditional GET is telling the
server to send the object only if the object has been modified since the specified date.

5
HTTP: Conditional GET
• Suppose the object has not been modified since 9 Sep 2015 09:23:24. Then, fourth, the Web server
sends a response message to the cache:

• We see that in response to the conditional GET, the Web server still sends a response message but
does not include the requested object in the response message.
• Including the requested object would only waste bandwidth and increase the response time,
particularly if the object is large. Note that this last response message has 304 Not Modified in the
status line, which tells the cache that it can forward its cached copy of the object to the requesting
browser. 6
Electronic Mail
• Electronic mail, commonly shortened to “email,” is a communication method that uses
electronic devices to deliver messages across computer networks. "Email" refers to both the
delivery system and individual messages that are sent and received.
• Email has existed in some form since the 1970s, when programmer Ray Tomlinson created a
way to transmit messages between computer systems on the Advanced Research Projects
Agency Network (ARPANET). Modern forms of email became available for widespread public
use with the development of email client software (e.g. Outlook) and web browsers, the latter
of which enables users to send and receive messages over the Internet using web-based email
clients (e.g. Gmail).
• The Figure on next slide shows the internet mail system and its key components:

7
Electronic Mail

8
Electronic Mail
• The internet email system has three major
components: user agents, mail servers, and
the Simple Mail Transfer Protocol (SMTP).

• User agents allow users to read, reply to,


forward, save, and compose messages.
Examples of user agents for e-mail include
Microsoft Outlook, Apple Mail, Web-based
Gmail, the Gmail App running in a
smartphone, and so on.

• When a user is finished composing his


message, his user agent sends the message to
his mail server where the message is placed in
the mail server’s outgoing message queue.

• When other user wants to read a message, his


user agent retrieves the message from the
mailbox in his mail server (on his end). 9
Electronic Mail
• Mail servers form the core of the e-mail
infrastructure. Each recipient has a mailbox
located in one of the mail servers. A user’s
mailbox manages and maintains the messages
that have been sent to him.

• A typical message starts its journey in the


sender’s user agent, then travels to the
sender’s mail server, and then travels to the
recipient’s mail server, where it is deposited in
the recipient’s mailbox.

• When recipient user wants to access the


messages in his mailbox, the mail server
containing his mailbox authenticates that user
(with his username and password).

10
Electronic Mail
• Sender’s mail server must also deal with
failures in recipient's mail server. If sender’s
server cannot deliver mail to recipient’s server,
it holds the message in a message queue and
attempts to transfer the message later.

• SMTP is the principal application-layer


protocol for Internet electronic mail. It uses
the reliable data transfer service of TCP to
transfer mail from the sender’s mail server to
the recipient’s mail server.

• As with most application-layer protocols,


SMTP has two sides: a client side, which
executes on the sender’s mail server, and a
server side, which executes on the recipient’s
mail server.

11
Electronic Mail
• Both the client and server sides of
SMTP run on every mail server.
When a mail server sends mail to
other mail servers, it acts as an
SMTP client. When a mail server
receives mail from other mail
servers, it acts as an SMTP server.

12
Electronic Mail: SMTP
• The Simple Mail Transfer Protocol (SMTP), is defined in RFC 5321 and is at the heart of Internet
electronic mail. As mentioned above, SMTP transfers messages from senders’ mail servers to the
recipients’ mail servers.
• SMTP is a legacy technology that possesses certain archaic (old-fashioned) characteristics. For
example, it restricts the body (not just the headers) of all mail messages to simple 7-bit ASCII. This
restriction made sense in the early 1980s when transmission capacity was scarce and no one was e-
mailing large attachments or large image, audio, or video files. But today, in the multimedia era, the
7-bit ASCII restriction is a bit of a pain—it requires binary multimedia data to be encoded to ASCII
before being sent over SMTP; and it requires the corresponding ASCII message to be decoded back
to binary after SMTP transport.

13
Electronic Mail: SMTP

• It is important to note that SMTP does not normally use intermediate mail servers for
sending mail, even if the two mail servers are located at opposite ends of the world.

• For example, If sender’s server is in Hong Kong and receiver’s server is in St. Louis, the TCP
connection is a direct connection between the Hong Kong and St. Louis servers. In
particular, if receiver’s mail server is down, the message remains in sender’s mail server
and waits for a new attempt—the message does not get placed in some intermediate mail
server.

14
Electronic Mail: Message Formats

• The Email message format includes the Message Header and Message Body.
• The message header and body of the message are separated by a blank line (that is, by
CRLF).
• The message header must have a “From: header line” and a “To: header line”; a header
may include a “Subject: header line” as well as other “optional header lines”. A typical
message header looks like this:

• After the message header, a blank line follows; then the message body (in ASCII) follows.

15
E-mail protocols and their communicating entities

• As shown in Figure, Alice’s user agent uses SMTP or HTTP to deliver the e-mail message
into her mail server, then Alice’s mail server uses SMTP (as an SMTP client) to relay the e-
mail message to Bob’s mail server.
• But there is still one missing piece to the puzzle! How does a recipient like Bob, running a
user agent on his local host , obtain his messages, which are sitting in a mail server? Note
that Bob’s user agent can’t use SMTP to obtain the messages because obtaining the
messages is a pull operation, whereas SMTP is a push protocol. 16
E-mail protocols and their communicating entities

• Today, there are two common ways for Bob to retrieve his e-mail from a mail server. If Bob is using
Web-based e-mail or a smartphone app (such as Gmail), then the user agent will use HTTP to
retrieve Bob’s e-mail. This case requires Bob’s mail server to have an HTTP interface as well as an
SMTP interface (to communicate with Alice’s mail server). The alternative method, typically used
with mail clients such as Microsoft Outlook, is to use the Internet Mail Access Protocol (IMAP)
defined in RFC 3501. Both the HTTP and IMAP approaches allow Bob to manage folders, maintained
in Bob’s mail server. Bob can move messages into the folders he creates, delete messages, mark
messages as important, and so on. 17
Thank you.

18

You might also like