Application Layer

2.4 Electronic Mail and the Internet

Home
Introduction
2.1 Principles of Network Applications
2.1.1 Network Application Architectures
2.1.2 Processes Communcating
2.1.3 Application-Layer Protocols
2.1.4 What Services Does an Application Need?
2.1.5 Services Provided by the Internet Transport Protocols
2.2 The Web and HTTP
2.2.1Overview of HTTP
2.2.2 Nonpersistent and Persistent Connections
2.2.3 HTTP Message Format
2.2.4 User-Server Ineraction: Cookies
2.2.5 HTTP Content
2.2.6 Web Caching
2.2.7 The Conditional GET
2.3 File Transfer: FTP
2.3.1 FTP Commands and Replies
2.4 Electronic Mail in the Internet
2.4.1 STMP
2.4.2 Comparison with HTTP
2.4.3 Mail Message Formats and MIME
2.4.4 Mail Access Protocols
2.5 DNS--The Internet's Directory Service
2.5.1 Services Provided by DNS
2.5.2 Overview of How DNS Works
2.5.3 DNS Records and Messages
2.6 P2P File Sharing
2.7 Socket Programming with TCP
2.7.1 Socket Programming with TCP
2.7.2 An Example Client/Server Application in Java
2.8 Socket Programming with UDP

2.4.2 Comparison with HTTP

Briefly compare SMTP with HTTP.  Both protocols are used to transfer files from one host to another: HTTP transfers files from a Web server to a Web client; SMTP transfers files from one mail server to another mail server.  When transferring the files, both persistent HTTP and SMTP use persistent connections.  The two protocols have common characteristics. 
 
There are important differences:
  • HTTP is mainly a pull protocol--someone loads information on a Web server and users use HTTP to pull the information from the server at their convenience.  The TCP connection is initiated by the machine that wants to receive the file.  On the other hand, SMTP is primarily a push protocol--the sending mail server pushes the file to the receiving mail server.  The TCP connection is initiated by the machine that wants to send the file.
  • SMTP requires each message, including the body of each message, to be in 7-bit ASCII format.  If the message contains characters that are not 7-bit ASCII or contains binary data, then the message has to be enclosed into 7-bit ASCII.  HTTP data does not impose this restriction.
  • A document consisting of text and images is handled.  HTTP encapsulates each object in its own HTTP response message.  Internet mail places all of the message's objects into one message.