William Stallings Data and Computer Communications Chapter 19

  • Slides: 28
Download presentation
William Stallings Data and Computer Communications Chapter 19 Distributed Applications (e-mail and www)

William Stallings Data and Computer Communications Chapter 19 Distributed Applications (e-mail and www)

Electronic Mail z Most heavily used application on any network z Simple Mail Transfer

Electronic Mail z Most heavily used application on any network z Simple Mail Transfer Protocol (SMTP) y. Delivery of simple text messages z Multi-purpose Internet Mail Extension (MIME) y. Delivery of other types of data y. Voice, images, video clips

SMTP z RFC 821 z Not concerned with format of messages or data y.

SMTP z RFC 821 z Not concerned with format of messages or data y. Covered in RFC 822 (see later) z SMTP uses info written on “envelope” y. Message header z Does not look at contents z Except: y. Standard character set: 7 bit ASCII y. Add log info to start of message x. Shows path taken

SMTP Mail Flow

SMTP Mail Flow

Mail Message Contents z Each queued message has: y. Message text y. A list

Mail Message Contents z Each queued message has: y. Message text y. A list of mail destinations

SMTP Sender z Takes message from queue z Transmits to proper destination host y.

SMTP Sender z Takes message from queue z Transmits to proper destination host y. Via SMTP transaction y. Over one or more TCP connections to port 25 z When delivery is completed, sender deletes destination from list for that message z When all destinations processed, message is deleted

Possible Errors z Host unreachable z Host out of operation z TCP connection fail

Possible Errors z Host unreachable z Host out of operation z TCP connection fail during transfer z Sender can re-queue mail y. Give up after a period z Faulty destination address y. User error y. Target user changed address y. Redirect if possible y. Inform user if not

SMTP Protocol - Reliability z Used to transfer messages from sender to receiver over

SMTP Protocol - Reliability z Used to transfer messages from sender to receiver over TCP connection z Attempts to provide reliable service z No guarantee to recover lost messages z No end to end acknowledgment to originator z Generally considered reliable

SMTP Receiver z Accepts arriving message z Places in user mailbox or copies to

SMTP Receiver z Accepts arriving message z Places in user mailbox or copies to outgoing queue forwarding z Sender responsible for message until receiver confirm complete transfer y. Indicates mail has arrived at host, not user

Scope of SMTP z SMTP limited to conversation between sender and receiver z Main

Scope of SMTP z SMTP limited to conversation between sender and receiver z Main function is to transfer messages z Rest of mail handling beyond scope of SMTP y. May differ between systems

SMTP System Overview z Commands and responses between sender and receiver over a TCP

SMTP System Overview z Commands and responses between sender and receiver over a TCP connection y. Sender sends commands to receiver y. Each command generates exactly one reply z Basic SMTP operation y. Connection setup y. Mail transfer y. Connection termination

Connection Setup z Sender opens TCP connection with receiver z Once connected, receiver identifies

Connection Setup z Sender opens TCP connection with receiver z Once connected, receiver identifies itself y 220 <domain> service ready z Sender identifies itself y. HELO z Receiver accepts sender’s identification y 250 OK z If mail service not available, step 2 above becomes: y 421 service not available

Mail Transfer z Sender may send one or more messages to receiver z MAIL

Mail Transfer z Sender may send one or more messages to receiver z MAIL command identifies originator y. Receiver returns 250 OK or appropriate fail/error message z One or more RCPT commands identifies recipients for the message y. Separate reply for each recipient z DATA command transfers message text y. End of message indicated by line containing just period (. )

RFC 882 z Format for text messages z Message is sequence of lines of

RFC 882 z Format for text messages z Message is sequence of lines of text y. Uses general memo framework y. Header usually keyword followed by colon followed by arguments z Example: Date: Tue, 16 Jan 1996 10: 37: 17 (EST) From: “William Stallings” <ws@host. com> Subject: The syntax of RFC 822 To: Smith@otherhost. com Cc: Jones@Yet-another_host. com This is the main text, delimited from the header by a blank line.

Multipurpose Internet Mail Extension (MIME) z Extension to RFC 822 z SMTP can not

Multipurpose Internet Mail Extension (MIME) z Extension to RFC 822 z SMTP can not transmit executables or binary y Uuencode and other schemes are available z Can not transmit text including international characters (e. g. â, å, ä, è, é, ê, ë) y RFC 822 is 7 -bit ASCII, need 8 -bit ASCII z MIME y RFCs 2045, 2046, 2047, 2048 and 2049

Overview of MIME z Different applications can be bundled into a single message yaudio,

Overview of MIME z Different applications can be bundled into a single message yaudio, video, text, image yapplications

MIME Transfer Encodings z Reliable delivery across wide largest range of environments z Content

MIME Transfer Encodings z Reliable delivery across wide largest range of environments z Content transfer encoding field y Six values y Three (7 bit, 8 bit, binary) no encoding done x. Provide info about nature of data z Quoted-printable y useful when data is largely printable ASCII characters y printable characters are not encoded y Non-printing characters represented by hex code z Base 64 y Maps arbitrary binary input onto printable output

Base 64 Encoding

Base 64 Encoding

Hypertext Transfer Protocol HTTP z Underlying protocol of the World Wide Web z Can

Hypertext Transfer Protocol HTTP z Underlying protocol of the World Wide Web z Can transfer plain text, hypertext, audio, images, and Internet accessible information

HTTP Overview z Transaction oriented client/server protocol z Usually between Web browser (client) and

HTTP Overview z Transaction oriented client/server protocol z Usually between Web browser (client) and Web server z Uses TCP connections z Stateless y. Each transaction treated independently y. New TCP connection for each transaction y. Terminate connection when transaction completes

Examples of HTTP Operation

Examples of HTTP Operation

HTTP Messages z Simple request/response mechanism z Requests y. Client to server z Responses

HTTP Messages z Simple request/response mechanism z Requests y. Client to server z Responses y. Server to client

HTTP Message Structure

HTTP Message Structure

Request z Request-Line = Method <SP> Request_URL <SP> HTTP-Version <CRLF> z Several Methods -

Request z Request-Line = Method <SP> Request_URL <SP> HTTP-Version <CRLF> z Several Methods - some examples y Get y Head y Delete y Put

Request Header Field z Additional parameters about requests - some examples y Accept charset

Request Header Field z Additional parameters about requests - some examples y Accept charset y Accept language y If modified since y Referrer y User agent

Response Messages z Status line followed by one or more general, response and entity

Response Messages z Status line followed by one or more general, response and entity headers, followed by optional entity body z Status-Line = HTTP-Version <SP> Status-Code <SP> Reason-Phrase <CRLF> z Response Header Fields - an example y. Server (info about server software)

Entity Header z Optional information about the entity - some examples y. Content language

Entity Header z Optional information about the entity - some examples y. Content language y. Content length y. Content type y. Last modified

Entity Body z Actual Data z HTTP transfers any type of data including: ytext

Entity Body z Actual Data z HTTP transfers any type of data including: ytext ybinary data yaudio yimages yvideo z Interpretation of data determined by header fields