1 / 55

DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 6:

DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 6: APPLICATION LAYER. Prepared By: Mdm Noor Suhana Bt Sulaiman FKMT-NT, TATiUC. DOMAIN NAME SYSTEM. Imagine a world without DNS You would have to remember the IP addresses of Every website you want to visit

zola
Download Presentation

DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 6:

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. DNT 1013 DATA COMMUNICATIONS ------------------------------------------ CHAPTER 6: APPLICATION LAYER Prepared By: Mdm Noor Suhana Bt Sulaiman FKMT-NT, TATiUC

  2. DOMAIN NAME SYSTEM

  3. Imagine a world without DNS You would have to remember the IP addresses of Every website you want to visit Your bookmarks will be a list of IP addresses You will speak like “I went to 167.33.24.10, and there was an awesome link to 153.11.35.81… “ DNS: Domain Name System

  4. DNS- Hostnames • IP Addresses are great for computers • IP address includes information used for routing. • IP addresses are tough for humans to remember. • IP addresses are impossible to guess. • ever guessed at the name of a WWW site?

  5. The Domain Name System • The domain name system is usually used to translate a host name into an IP address . • Domain names comprise a hierarchy so that names are unique, yet easy to remember.

  6. DNS Hierarchy edu com org jp rpi albany

  7. Host name structure • Each host name is made up of a sequence of labels separated by periods. • Each label can be up to 63 characters • The total name can be at most 255 characters. • Examples: • whitehouse.gov • barney.the.purple.dinosaur.com • monica.cs.rpi.edu

  8. Domain Name • The domain name for a host is the sequence of labels that lead from the host (leaf node in the naming tree) to the top of the worldwide naming tree. • A domain is a subtree of the worldwide naming tree.

  9. Top level domains • edu, gov, com, net, org, mil, … • Countries each have a top level domain (2 letter domain name). • New top level domains include: .aero .biz .coop .info .name .pro

  10. Root DNS Servers org DNS servers edu DNS servers com DNS servers poly.edu DNS servers umass.edu DNS servers pbs.org DNS servers yahoo.com DNS servers amazon.com DNS servers Distributed, Hierarchical Database Client wants IP for www.amazon.com; 1st approx: • Client queries a root server to find .com DNS server • Client queries com DNS server to get amazon.com DNS server • Client queries amazon.com DNS server to get IP address for www.amazon.com

  11. contacted by local name server that can not resolve name root name server: contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server a Verisign, Dulles, VA c Cogent, Herndon, VA (also Los Angeles) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Verisign, ( 11 locations) k RIPE London (also Amsterdam, Frankfurt) i Autonomica, Stockholm (plus 3 other locations) m WIDE Tokyo e NASA Mt View, CA f Internet Software C. Palo Alto, CA (and 17 other locations) 13 root name servers worldwide b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA DNS: Root name servers

  12. REMOTE LOGGING, ELECTRONIC EMAIL & FILE TRANSFER

  13. 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, Netscape Messenger 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

  14. Mail Servers mailbox contains incoming messages for user messagequeue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server “server”: receiving mail server 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

  15. Mail Servers mailbox contains incoming messages for user messagequeue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send email messages client: sending mail server “server”: receiving mail server 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

  16. 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 Emails Bob 1 2 6 3 4 5

  17. Telenet into port 25 HELO hostname MAIL FROM RCPT TO RCPT TO … DATA … text … . QUIT You can try doing this yourself SMTP Commands to send email

  18. Try SMTP interaction for yourself: • telnet servername 25 • see 220 reply from server • enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader)

  19. 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 Comparison with HTTP: 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: final words

  20. 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

  21. MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type Think of image attachments with your email 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

  22. 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: Hotmail , Yahoo! Mail, etc. user agent user agent sender’s mail server SMTP Mail access protocols SMTP access protocol receiver’s mail server What’s the Difference?

  23. More about POP3 Previous example uses “download and delete” mode. Bob cannot re-read e-mail if he changes client “Download-and-keep”: copies of messages on different clients POP3 is stateless across sessions IMAP Keep all messages in one place: the server Allows user to organize messages in folders IMAP keeps user state across sessions: names of folders and mappings between message IDs and folder name POP3 (more) and IMAP

  24. FTP • File Transfer Protocol (FTP), a standard Internet protocol, is the simplest way to exchange files between computers on the Internet. • Like the Hypertext Transfer Protocol (HTTP), which transfers displayable Web pages and related files, and the Simple Mail Transfer Protocol (SMTP), which transfers e-mail, FTP is an application protocol that uses the Internet's TCP/IP protocols. • FTP is commonly used to transfer Web page files from their creator to the computer that acts as their server for everyone on the Internet. • It's also commonly used to download programs and other files to computer from other servers.

  25. Cont.. • User can use FTP with a simple command line interface (for example, from the Windows MS-DOS Prompt window) or with a commercial program that offers a graphical user interface. • User Web browser can also make FTP requests to download programs you select from a Web page. • Using FTP, user can also update (delete, rename, move, and copy) files at a server. • User need to logon to an FTP server. However, publicly available files are easily accessed using anonymous FTP.

  26. Cont.. • Basic FTP support is usually provided as part of a suite of programs that come with TCP/IP. • However, any FTP client program with a graphical user interface usually must be downloaded from the company that makes it.

  27. Web Server • A computer program that is responsible for accepting HTTP requests from clients (user agents such as web browsers), and serving them HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects (images, etc.). • A computer that delivers (serves up) Web pages. Every Web server has an IP address and possibly a domain name • For example, if you enter the URL http://www.pcwebopedia.com/index.html in your browser, this sends a request to the server whose domain name is pcwebopedia.com. • The server then fetches the page named index.html and sends it to your browser. • Any computer can be turned into a Web server by installing server software and connecting the machine to the Internet. • There are many Web server software applications, including public domain software from NCSA and Apache, and commercial packages from Microsoft, Netscape and others.

  28. Cont.. • Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol ( HTTP ), serves the files that form Web pages to Web users (whose computers contain HTTP clients that forward their requests). • Every computer on the Internet that contains a Web site must have a Web server program. Two leading Web servers are Apache , the most widely-installed Web server, and Microsoft's Internet Information Server ( IIS ). • Other Web servers include Novell's Web Server for users of its NetWare operating system and IBM's family of Lotus Domino servers, primarily for IBM's OS/390 and AS/400 customers.

  29. Cont.. • Web servers often come as part of a larger package of Internet- and intranet-related programs for serving e-mail, downloading requests for File Transfer Protocol ( FTP ) files, and building and publishing Web pages. • Considerations in choosing a Web server include how well it works with the operating system and other servers, its ability to handle server-side programming, security characteristics, and publishing, search engine, and site building tools that may come with it.

  30. Cont.. • The origin of the content sent by server is called: • static if it comes from an existing file lying on a filesystem; • dynamic if it is dynamically generated by some other program or script or application programming interface (API) called by the web server. • Serving static content is usually much faster (from 2 to 100 times) than serving dynamic content, especially if the latter involves data pulled from a database.

  31. Web Server features Although web server programs differ in detail, they all share some basic common features. • HTTP: every web server program operates by accepting HTTP requests from the client, and providing an HTTP response to the client. The HTTP response usually consists of an HTML document, but can also be a raw file, an image, or some other type of document (defined by MIME-types). If some error is found in client request or while trying to serve it, a web server has to send an error response which may include some custom HTML or text messages to better explain the problem to end users. • Logging: usually web servers have also the capability of logging some detailed information, about client requests and server responses, to log files; this allows the webmaster to collect statistics by running log analyzers on these files.

  32. 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

  33. 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) aside 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

  34. 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

  35. HTTP Protocol • HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web. • As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. • HTTP is an application protocol that runs on top of the TCP/IP suite of protocols (the foundation protocols for the Internet). • In order to fetch a web page for you, your web browser must "talk" to a web server somewhere else. • When web browsers talk to web servers, they speak a language known as HTTP, which stands for HyperText Transfer Protocol. • The latest version of HTTP is HTTP 1.1.

  36. Cont.. • HTTP concepts include (as the Hypertext part of the name implies) the idea that files can contain references to other files whose selection will elicit additional transfer requests. • Any Web server machine contains, in addition to the Web page files it can serve, an HTTP daemon, a program that is designed to wait for HTTP requests and handle them when they arrive. • Your Web browser is an HTTP client, sending requests to server machines. • When the browser user enters file requests by either "opening" a Web file (typing in a Uniform Resource Locator or URL) or clicking on a hypertext link, the browser builds an HTTP request and sends it to the Internet Protocol address (IP address) indicated by the URL. • The HTTP daemon in the destination server machine receives the request and sends back the requested file or files associated with the request. (A Web page often consists of more than one file.)

  37. Cont.. • Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. • Its use for retrieving inter-linked resources led to the establishment of the World Wide Web. • HTTP development was coordinated by the World Wide Web Consortium and the Internet Engineering Task Force (IETF), culminating in the publication of a series of Requests for Comments (RFCs), most notably RFC 2616 (June 1999), which defines HTTP/1.1, the version of HTTP in common use.

  38. Cont.. • HTTP is a request/response standard between a client and a server. • A client is the end-user, the server is the web site. The client making a HTTP request—using a web browser, spider, or other end-user tool—is referred to as the user agent. • The responding server—which stores or creates resources such as HTML files and images—is called the origin server. • In between the user agent and origin server may be several intermediaries, such as proxies, gateways, and tunnels. • HTTP is not constrained to using TCP/IP and its supporting layers, although this is its most popular application on the Internet. Indeed HTTP can be "implemented on top of any other protocol on the Internet, or on other networks. • HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used

  39. Cont.. • HTTP predominantly uses TCP and not UDP because much data must be sent for a webpage, and TCP provides transmission control, presents the data in order, and provides error correction. • Resources to be accessed by HTTP are identified using Uniform Resource Identifiers (URIs) (or, more specifically, Uniform Resource Locators (URLs)) using the http: or https URL schemes.

  40. HTTP Transaction • HTTP uses only one TCP connection on Well-Known port 80 • Ex) protocol://hostname[:port]/path/filename

  41. Cont.. • Step 1: Connection Establishment • TCP/IP connection set up • uses a port number as application reference • usually port 80 • ports ≤ 1024 are privileged (>1024 are open) • Step 2: Client’s request • HTTP message sent with a request line • Step 3: Server Response • server sends HTTP message and optionally requested data • Step 4: Server Disconnection • usually the server • sometimes the client “stops” it

  42. Cont.. • http is “stateless” • server maintains no information about past client requests • each operation or transaction makes a new connection • each operation is unaware of any other connection • each click is a new connection

  43. Message • Message categories • Request message : Client  Server • Response message : Server  Client

  44. Request message format

  45. Request Line • Request line • Request type : methods (GET,HEAD,POST…) • Uniform Resource Locator (URL) : Protocol (FTP,HTTP,TELNET…) • HTTP version : HTTP 1.1(1.0, 0.9 are still in use)

  46. Cont.. • Resources • A resource is a chunk of information that can be identified by a URL(Universal Resource Locator) • A resource can be • A file • A dynamically created page • What we see on the browser can be a combination of some resources

  47. Cont.. • URL(Uniform Resource Locator) • Method is the protocol used to retrieve the document • among them are FTP, HTTP, News and TELNET

  48. Methods • Methods • Methods is actual command or request that a client issues to the server • Methods kinds • GET • Client wants to retrieve a document from the server • Responds with the contents of the document in the body of the response message • HEAD • Client wants some information about a document • Response from the server does net contain a body (different from GET) • POST • Client provides some information for the server • ex) send input to a server

  49. Cont.. • Methods kinds • PUT • Client provides a new or replacement document to be stored on the server • Included in the body of the request and will be stored in the location defined by the URL • PATCH • Only a list of differences that should be implemented in the existing file • COPY • Used to copy a file to another location • Location of the source file is given in the request line (URL), destination is given in the entity header • MOVE • Used to move a file to another location • Location of the source file is given in the request line (URL), destination is given in the entity header

  50. Cont.. • Methods kinds • DELETE • Used to remove a document on the server • LINK • Used to create a link or links from a document to another location • Location of the source file is given in the request line (URL), destination is given in the entity header • UNLINK • Used to delete links created by the LINK methods • OPTION • Used by the client to ask the server about available options • CHECKIN, CHECKOUT, SHOWMETHOD, SPACEJUMP etc.

More Related