1 / 70

ITC242 – Introduction to Data Communications Internet Based Applications

ITC242 – Introduction to Data Communications Internet Based Applications. Last Week. TCP/IP and OSI Describe the definition of a protocol; Discuss the need and benefits of using protocol architectures; Describe the TCP/IP protocol architecture Describe the OSI reference model.

Download Presentation

ITC242 – Introduction to Data Communications Internet Based Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ITC242 – Introduction to Data CommunicationsInternet Based Applications

  2. Last Week TCP/IP and OSI • Describe the definition of a protocol; • Discuss the need and benefits of using protocol architectures; • Describe the TCP/IP protocol architecture • Describe the OSI reference model.

  3. Topic 6 Internet Based Applications Learning Objectives • describe electronic mail and the basic function of SMTP • explain the need for MIME • explain the role of HTTP in the operation of the Web • describe the functions of proxies, gateways and tunnels in HTTP • recognise the role of SIP

  4. Question Which layer of OSI we will study in this class?

  5. Layering: The OSI Model layer-to-layer communication Application Application 7 7 Presentation Presentation 6 6 Session Session 5 5 Peer-layer communication Transport Transport Router Router 4 4 Network Network Network Network 3 3 Link Link Link Link 2 2 Physical Physical Physical Physical 1 1

  6. Message Preparation Word processing Annotation Message Sending User directory Timed delivery Multiple addressing Message priority Status information Interface to other facilities Message Receiving Mailbox scanning Message selection Message notification Message reply Message rerouting Electronic Mail Features

  7. Public vs Private Email • Public • Provided by a 3rd party vendor • Available over one or more public networks • Examples: MCI Mail, AOL • Private • Integrated with user’s computer equipment • Often part of an integrated tool, eg PROFS • Used for internal messaging • Internet mail does not fit into either of these categories; it is a transfer mechanism rather than a contained system

  8. Three major components: user agents mail servers simple mail transfer protocol: SMTP User Agent a.k.a. “mail reader” composing, editing, reading mail messages e.g., Eudora, Outlook, elm, Mozilla Thunderbird outgoing, incoming messages stored on server user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server outgoing message queue user mailbox Electronic Mail

  9. Mail Servers mailbox contains incoming messages for user messagequeue of outgoing (to be sent) mail messages SMTP protocol (see the next) user agent user agent user agent user agent user agent user agent SMTP SMTP SMTP mail server mail server mail server Electronic Mail: mail servers

  10. uses TCP to reliably transfer email message from client to server, port 25 direct transfer: sending server ( “client”) to receiving server( “server”) three phases of transfer handshaking (greeting) transfer of messages closure command/response interaction commands: ASCII text response: status code and phrase messages must be in 7-bit ASCII SMTP [RFC 2821]

  11. 1) Alice uses UA to compose message and “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message user agent user agent mail server mail server Scenario: Alice sends message to Bob 1 2 6 3 4 5

  12. Sample SMTP interaction SMIT Client: C SMIT server: S S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 250 bob@hamburger.edu ... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C: . S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection Sending message Status code: 220 Service Ready 250 OK 421 Service Not Available Commands: HELO(HELLO), MAIL FROM, RCPT TO, DATA, QUIT

  13. SMTP Connection Setup • Sender opens TCP connection to receiver • Receiver acknowledges connection with “220 Service Ready” or “421 Service Not Available” • If connection is made, sender identifies itself with the “HELO” command • Receiver accepts identification with “250 OK”

  14. SMTP Mail Transfer • MAIL command identifies originator, provides reverse path for error reporting • RCPT commands identify recipient(s) for message • Receiver has several positive or negative responses to RCPT • Sender will not send message until it is sure at least one copy can be delivered • DATA command transfers message

  15. SMTP Connection Closing • Sender sends a QUIT command to initiate TCP close operation • Receiver sends a reply to the QUIT command, then initiates its own close

  16. Single System E-Mail

  17. Single System E-Mail • Only allows users of a shared system to exchange messages • Each user has unique identifier and mailbox • Sending a message simply puts it into recipients’ box • Example: AOL

  18. Multiple Systems E-Mail

  19. Multiple Systems E-Mail • Distributed system enables mail servers to connect over a network to exchange mail • Functions split • User agent handles preparation, submission, reading, filing, etc • Transfer agent receives mail from user, determines routing, communicates with remote systems • Interconnection requires standards

  20. Request For Comments • Form the basis of the Internet's technical documentation. • Conceptually, the Internet as a layered series of protocols, each is documented by one or more RFCs. • RFCs don’t change. Updates documented by new RFCs. • Not all RFCs document protocols; Some for discussion, informational purposes, April Fools' RFCs distinguished by their date. • There are more than 2000 RFCs in existence, dating back to ARPANET in the 1970s. • Most RFCs are available as large text files, with graphics made out of typewriter characters. http://www.freesoft.org/CIE/RFC/

  21. Basic E-Mail Operation • User creates message with user agent program • Text includes RFC 822 header and body of message • List of destinations derived from header • Messages are queued and sent to SMTP sender program running on a host

  22. SMTP Mail Flow • SMTP server transmits messages to appropriate hosts via TCP • Multiple messages to same host can be sent on one connection • Errors handling necessary for faulty addresses and unreachable hosts • SMTP protocol attempts to provide error-free transmission, but does not provide end-to-end acknowledgement • SMTP receiver accepts messages, places it in mailbox or forwards

  23. SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939] authorization (agent <-->server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: gmail, Hotmail, Yahoo! Mail, etc. user agent user agent sender’s mail server SMTP Mail access protocols SMTP access protocol receiver’s mail server

  24. RFC 822 • Defines format for text messages via electronic mail • Used by SMTP as accepted mail format • Specifies both envelope and contents • Includes a variety of headers that can be included in the message header lines

  25. SMTP: protocol for exchanging email msgs RFC 822: standard for text message format: header lines, e.g., To: From: Subject: differentfrom SMTP commands! body the “message”, ASCII characters only Mail message format header blank line body

  26. SMTP uses persistent connections SMTP requires message (header & body) to be in 7-bit ASCII SMTP server uses CRLF.CRLF to determine end of message SMTP: final words

  27. Question • Why we are able to send emails with attached image files? RFC 822 was defined for sending ordinary ASCII text, but not sufficiently rich for multimedia messages, or for carrying non-ASCII text formats( for example, characters used by language other than English)

  28. Limitations of SMTP and RFC822 • Cannot transmit executables or binary files without conversion into text through non-standard programs (e.g. UUENCODE) • Cannot transmit diacritical marks • Transfers limited in size • Gateways do not always map properly between EBCDIC and ASCII • Cannot handle non-text data in X.400 messages • Not all SMTP implementations adhere completely to RFC821 (tabs, truncation, etc)

  29. MIME (Multipurpose Internet Mail Extensions) • Intended to resolve problems with SMTP and RFC822 • Specifies five new header fields, providing info about body of message • Defines multiple content formats • Defines encodings to enable conversion of any type of content into transferable form

  30. MIME Header Fields • MIME-Version: Indicates compliance with RFCs 1521 and 1522 • Content-Type: Describes data in sufficient detail for receiver to pick method for representation • Content-Transfer-Encoding: Indicates type of transformation used to represent content • Content-ID: Used to uniquely identify MIME entities • Content-Description: Plain text description for use when object is not readable

  31. MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data ..... ......................... ......base64 encoded data Message format: multimedia extensions MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data

  32. HTTP Overview • Stateless protocol • TCP connection terminated as soon as transaction completes • Flexible in format handling

  33. www.someschool.edu/someDept/pic.gif path name host name Web and HTTP First some jargon • Web page consists of objects • Object can be HTML file, JPEG image, Java applet, audio file,… • Web page consists of base HTML-file which includes several referenced objects • Each object is addressable by a URL • Example URL:

  34. HTTP: hypertext transfer protocol Web’s application layer protocol client/server model client: browser that requests, receives, “displays” Web objects server: Web server sends objects in response to requests HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068 HTTP overview HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator

  35. Uses TCP: client initiates TCP connection (creates socket) to server, port 80 server accepts TCP connection from client HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed HTTP is “stateless” server maintains no information about past client requests HTTP overview (continued) Protocols that maintain “state” are complex! • past history (state) must be maintained • if server/client crashes, their views of “state” may be inconsistent, must be reconciled

  36. Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode HTTP connections

  37. Suppose user enters URL www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 Nonpersistent HTTP (contains text, references to 10 jpeg images) 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time

  38. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects Nonpersistent HTTP (cont.) 4. HTTP server closes TCP connection. time 6.Steps 1-5 repeated for each of 10 jpeg objects

  39. initiate TCP connection RTT request file time to transmit file RTT file received time time Non-Persistent HTTP: Response time Definition of RTT: time to send a small packet to travel from client to server and back. Response time: • one RTT ( round-trip time) to initiate TCP connection • one RTT for HTTP request and first few bytes of HTTP response to return • file transmission time total = 2RTT+transmit time

  40. Nonpersistent HTTP issues: requires 2 RTTs per object OS overhead for each TCP connection browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP server leaves connection open after sending response subsequent HTTP messages between same client/server sent over open connection Persistent HTTP

  41. HTTP request message • two types of HTTP messages: request, response • HTTP request message: • ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) header lines Carriage return, line feed indicates end of message

  42. Post method: Web page often includes form input Input is uploaded to server in entity body URL method: Uses GET method Input is uploaded in URL field of request line: Uploading form input www.somesite.com/animalsearch?monkeys&banana

  43. HTTP/1.0 GET POST HEAD asks server to leave requested object out of response HTTP/1.1 GET, POST, HEAD PUT uploads file in entity body to path specified in URL field DELETE deletes file specified in the URL field Method types

  44. HTTP response message status line (protocol status code status phrase) HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... header lines data, e.g., requested HTML file

  45. 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported HTTP response status codes In first line in server->client response message. A few sample codes:

  46. HTTP Operation

  47. HTTP Intermediate Systems • Proxy • Forwarding agent • Security intermediary • Different versions of HTTP • Gateway • Security intermediary • Non-HTTP server • Tunnel • Relay point between two TCP connections • Cache • Facility storing previous requests and responses

  48. Intermediate System Examples

  49. HTTP: pull SMTP: push both have ASCII command/response interaction, status codes HTTP: each object encapsulated in its own response msg SMTP: multiple objects sent in multipart msg SMTP and HTTP

  50. Session Initiation Protocol (SIP) • Defined in RFC 3261 • Manages real-time sessions over IP data network • Intended to enable Internet telephony/VoIP • Based on HTTP-like request/response transaction model • Five facets • User location • User availability • User capabilities • Session setup • Session management

More Related