CPSC 3600 - DAY 7 FEBRUARY 1, 2017 ================================================================================ INTERNET APPLICATIONS (PRESENTATION) ------------------------------------ .Application-Layer Protocols .There are two broad types of application-layer protocols when specifying details of communication. .Private communication - two applications communicate over the internet so that only those two communciate .Standardized service: a service that has multiple clients access the service; this means the programmer must be precise to make sure everyone can interoperate correctly. .Representation and Transfer .Data Representation - Syntax of data items that are exchanged specific during transfer, translation of integers, characters and files between computers .Data Transfer - Interaction between client and server, message syntax and semantics, valid and invalid exchange error handling, termination of interaction. WEB PROTOCOLS ------------- .HyperText Markup Language (HTML) - A representation standard used to specify the contents and layout of a web page. .Uniform Resource Locator (URL) - A representation standard that specifies the format and meaning of web page identifiers .HyperText Transfer Protocol (HTTP) - A transfer protocol that specifies how a browser interacts with a web server to transfer data. .HTML - General Characteristics: .Uses textual representation .Describes pages containing multimedia .Declarative paradigm, not procedural .Provides markup specifications instead of formatting .Permits a hyperlink to be embedded in an object. .Allows a document to include metadata. .Uniform Resource Locator .Specifies the web page itself http://www.scriptingmaster.com/xhtml/using-colors.asp ^----^ ^----------------------^^---^^----------------^ protocol host name folder name file name .HTTP .the primary transfer protocol that a browser uses to interact with a web server. .Uses textual control messages .Transfers binary data files .Download and upload data .Caching +-----------------------+---------------------------------------------+ | Request | Description | +-----------------------+---------------------------------------------+ | Get | Requests a document; server responds by | | | sending status information followed by copy | +-----------------------+---------------------------------------------+ | Head | Requests status information; server sends | | | status, but does not send copy of doc. | +-----------------------+---------------------------------------------+ | Post | Sends data to server; server appends data to| | | specified item. | +-----------------------+---------------------------------------------+ | Put | Sends data to a server; the server uses data| | | to completely replace specify item | +-----------------------+---------------------------------------------+ HOW HTTP WORKS -------------- .STATUS CODES .200: OK .400: BAD REQUEST .404: NOT FOUND .Caching in Browsers .A browser can reduce downtimes by saving a copy of each image in a cache on a user's disk and using than cached copy .A browser makes a HEAD request and compares the last-modified date of the server's copy to the last modified date on the cached copy. .Improves browser speed. FILE TRANSFER PROTOCOL ---------------------- .File: fundamental storage abstraction which holds an arbitrary object. .File transfer between computers is complicated by computer's hetero- geneity. .The first FTP applications were written in early 1970s .Arbitrary file contents .Bidirectional transfer .Support for authentication and ownership .Ability to browse folders .Textual control messages. .Accommodates heterogeneity .Client creates a control connection, which is reserved for commands .To respond, the server creates a data connection over which directory listing and files are sent. .inverted relationship between client and server. ELECTRONIC MAIL --------------- .Email has, since the 1960s, allowed a user on one computer to send message to other user, without users been online at same time. .Email interface application for composing and reading emails .Mail transfer application, which invokes SMTP to send messages