PART 6 Application Layer

Slides:



Advertisements
Similar presentations
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
Advertisements

TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
World Wide Web Basics Original version by Carolyn Watters (Dalhousie U. Computer Science)
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Application Layer Pertemuan 25 Matakuliah: H0484/Jaringan Komputer Tahun: 2007.
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
Layer 7- Application Layer
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Chapter 27 HTTP and WWW.
Definitions, Definitions, Definitions Lead to Understanding.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Computer Concepts 2014 Chapter 7 The Web and .
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Introduction of Web programming Ins. Elaf Alhazmi LECTURE 1.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Application Protocols: HTTP CSNB534 Semester 2, 2007/2008 Asma Shakil.
1 Computer Communication & Networks Lecture 28 Application Layer: HTTP & WWW p Waleed Ejaz
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Applets Chapter 17.  Java’s big splash onto the scene came in the mid 90’s. The people at Sun Microsystems had managed to work java programs into Web.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 2 Application Layer.
Web Programming : Building Internet Applications Chris Bates CSE :
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
TCP/IP (Transmission Control Protocol / Internet Protocol)
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW.
INTERNET PROTOCOLS. Microsoft’s Internet Information Server Home Page Figure IT2031 UNIT-3.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Free Powerpoint Templates Page 1 Free Powerpoint Templates CHAPTER 1 LAB 1.1 Web Server.
Tutorial 1 Getting Started with Adobe Dreamweaver CS5.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Instructor Materials Chapter 5 Providing Network Services
WWW and HTTP King Fahd University of Petroleum & Minerals
HTTP – An overview.
Evolution of Internet.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CASE STUDY -HTML,URLs,HTTP
Exploring Microsoft Office 2013 Word Comprehensive
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Communication & Networks
Chapter 27 WWW and HTTP.
HyperText Transfer Protocol
William Stallings Data and Computer Communications
PART 6 Application Layer
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Web Programming : Building Internet Applications Chris Bates CSE :
Presentation transcript:

PART 6 Application Layer

Position of Application Layer

Role of Application Layer Enables the user, whether human or software, to access the network Provides user interfaces and support for services such as electronic mail, remote file access and transfer, and access to the World Wide Web

General Issues of Application Layer Client-server Paradigm

General Issues of Application Layer Addressing Email address address to access a web page Types of Service Application layer is designed to give different services to the user or user programs. SMTP FTP WWW HTTP

Chapter 27 HTTP and WWW

27.1 HTTP HTTP is used mainly to access data on the WWW The protocol transfers data in the form of plain text, hypertext, audio, video, and so on. HTTP functions like a combination of FTP and SMTP. HTTP is much simpler than FTP because it uses only one TCP connection (well-known port 80) HTTP is like SMTP because the data transferred between the client and the server are similar to SMTP messages. SMTP messages are stored and forward, but HTTP messages are delivered immediately HTTP uses the services of TCP on well-known port 80

About SMTP Architecture of Simple Mail Transfer Protocol (SMTP)

HTTP (cont’d) The request and response messages carry data in the form of a letter with a MIME-like format. letter-like request and letter-like response messages * MIME :Multipurpose Internet Mail Extensions Transaction HTTP is stateless protocol; Each time you need something from the server, your client (browser) makes a connection, gets that file, and then the connection is closed. The client initializes the transaction by sending a request message. The sever replies by sending a response.

HTTP (cont’d) HTTP Transaction

HTTP (cont’d) Request Messages

HTTP (cont’d) Request line Request type : categorizing the request messages into several methods URL defines four things : method, host computer, port and path

HTTP (cont’d) The method is the protocol used to retrieve the document ex) FTP, HTTP The host is the computer where the information is located The port number of the server is optional. Path is the path name of the file where the information is located. Version of HTTP

HTTP (cont’d) Methods GET, HEAD, POST, PUSH, etc. Response Message

HTTP (cont’d) Status line Status code field is similar to those in the FTP and the SMTP Status phrase : explain the status code in text form

HTTP (cont’d) Headers Header format

HTTP (cont’d) General Header : gives general information about the messages Request Header : specifies the server’s configuration and special information about the request Response Header : specifies the server’s configuration and special information about the request Entity Header : gives information about the body of the document

Example 1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in GIF and JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Fig. 27.9, next slide).

Example 1 (cont’d)

Example 2 This example retrieves information about a document. We use the HEAD method to retrieve information about an HTML document (see the next section). The request line shows the method (HEAD), URL, and HTTP version (1.1). The header is one line showing that the client can accept the document in any format (wild card). The request does not have a body. The response message contains the status line and five lines of header. The header lines define the date, server, MIME version, type of document, and length of the document (see Fig. 27.10, next slide). Note that the response message does not contain a body

Example 2 (cont’d)

HTTP (cont’d) – Some Other Features Nonpersistent Connection The client opens a TCP connection The server sends the response and closes the connection The client reads the data until it encounters an end-of-file marker Persistent connection The server leaves the connection open for more request after sending a response HTTP version 1.1 specifies a persistent connection by default.

HTTP (cont’d) Proxy server HTTP supports proxy servers A proxy server is a computer that keeps copies of response to recent requests Reducing the load on the original sever, decreasing traffic, and improving latency

World Wide Web (WWW) A repository of information spread all over the world and linked together. The WWW project was initiated by CERN (European Laboratory for Particle Physics) to create a system to handle distributed resources necessary for scientific research. The WWW today is a distributed client-sever service, in which a client using a browser can access a service using a server

WWW (cont’d) The service provided is distributed over many locations called websites. Distributed Services

WWW (cont’d) Hypertext Hypermedia documents - including pictures, graphics and sound

WWW (cont’d) Browser architecture

WWW (cont’d) Categories of Web documents Static documents are fixed-content document that are created and stored in a server. The contents in the server can be changed, but the user cannot change it.

WWW (cont’d) Static document

WWW (cont’d) HTML (Hypertext Markup Language) - is a language for creating Web services

WWW (cont’d) Effect of boldface tags

WWW (cont’d) Beginning and ending tag = =

WWW (cont’d) Common tags Beginning Tag Ending Tag Meaning Skeletal Tags <HTML> </HTML> Defines an HTML document <HEAD> </HEAD> Defines the head of the document <BODY> </BODY> Defines the body of the document Title and Header Tags <TITLE> </TITLE> Defines the title of the document <Hn> </Hn>

WWW (cont’d) Common tags Beginning Tag Ending Tag Meaning Text Formatting Tags <B> </B> Boldface <I> </I> Italic <U> </U> Underlined <SUB> </SUB> Subscript <SUP> </SUP> Superscript Data Flow Tag <CENTER> </CENTER> Centered <BR> </BR> Line break

WWW (cont’d) Beginning Tag Ending Tag Meaning List Tags <OL> Ordered list <UL> </UL> Unordered list <LI> </LI> An item in a list Image Tag <IMG> Defines an image Hyperlink Tag <A> </A> Defines an address (hyperlink) Executable Contents <APPLET> </APPLET> The document is an applet

Example 3 This example shows how tags are used to let the browser format the appearance of the text <HTML> <HEAD> <TITLE> First Sample Document </TITLE> </HEAD> <BODY> <CENTER> <H1><B> ATTENTION </B></H1> </CENTER> You can get a copy of this document by: <UL> <LI> Writing to the publisher <LI> Ordering online <LI> Ordering through a bookstore </UL> </BODY> </HTML>

Example 4 This example shows how tags are used to import an image and insert it into the text <HTML> <HEAD> <TITLE> Second Sample Document </TITLE> </HEAD> <BODY> This is the picture of a book: <IMG SRC="Pictures/book1.gif" ALIGN=MIDDLE> </BODY> </HTML>

Example 5 This example shows how tags are used to make a hyperlink to another document. <HTML> <HEAD> <TITLE> Third Sample Document </TITLE> </HEAD> <BODY> This is a wonderful product that can save you money and time. To get information about the producer, click on <A HREF="http://www.phony.producer"> Producer </A> </BODY> </HTML>

WWW (cont’d) Dynamic document does not exist in a predefined format. is created by a Web server whenever a browser requests the document.

WWW (cont’d) Common Gateway Interface is a technology that creates and handles dynamic documents CGI program ~ is code written in one the languages supporting CGI

WWW (cont’d) Example 6 is a CGI program written in Bourne shell script. The program accesses the UNIX utility (date) that returns the date and the time. Note that the program output is in plain text. #!/bin/sh # The head of the program echo Content_type: text/plain echo # The body of the program now='date' echo $now exit 0

Example 7 Example 7 is similar to Example 6 except that program output is in HTML. #!/bin/sh # The head of the program echo Content_type: text/html echo # The body of the program echo <HTML> echo <HEAD><TITLE> Date and Time </TITLE></HEAD> echo <BODY> now='date' echo <CENTER><B> $now </B></CENTER> echo </BODY> echo </HTML> exit 0

Example 8 Example 8 is similar to Example 7 except that the program is written in Perl. #!/bin/perl # The head of the program print "Content_type: text/html\n"; print "\n"; # The body of the program print "<HTML>\n"; print "<HEAD><TITLE> Date and Time </TITLE></HEAD>\n"; print "<BODY>\n"; $now = 'date'; print "<CENTER><B> $now </B></CENTER>\n"; print "</BODY>\n"; print "</HTML>\n"; exit 0

WWW (cont’d) Active Documents For many applications, we need a program to be run at the client site. These are called active documents

Example 9 JAVA Skeleton of an Applet

WWW (cont’d) Installation of the object defined by an applet.

WWW (cont’d) Creation and compilation

WWW (cont’d) HTML document carrying an applet = = =

Example 9 In this example, we first import two packages, java.awt and java.applet. They contain the declarations and definitions of classes and methods that we need. Our example uses only one publicly inherited class called First. We define only one public method, paint. The browser can access the instance of First through the public method paint. The paint method, however, calls another method called drawString, which is defined in java.awt.*.

Example 9 First Example of Java import java.applet.*; import java.awt.*; public class First extends Applet { public void paint (Graphics g) { g.drawString ("Hello World", 100, 100); } }

Example 10 In this example, we modify the program in Example 9 to draw a line. Instead of method drawString, we use another method called drawLine. This method needs four parameters: the x and y coordinates at the beginning of the line and the x and y coordinates at the end of the line. We use 0, 0 for the beginning and 80, 90 for the end.

Example 10 Second example of Java import java.applet.*; import java.awt.*; public class Second extends Applet { public void paint (Graphics g) { g.drawLine (0, 0, 80, 90); } }

Thanks !