Presentation is loading. Please wait.

Presentation is loading. Please wait.

WWW and HTTP King Fahd University of Petroleum & Minerals

Similar presentations


Presentation on theme: "WWW and HTTP King Fahd University of Petroleum & Minerals"— Presentation transcript:

1 WWW and HTTP King Fahd University of Petroleum & Minerals
College of Computer Science & Engineering Information & Computer Science Department ICS 343 Fundamentals of Computer Networks WWW and HTTP These slides are based on: Chapter 27, Data Communications and Networking, 4th Edition

2 Topics discussed in this section:
ARCHITECTURE The WWW today is a distributed client/server service, in which a client using a browser can access a service using a server. However, the service provided is distributed over many locations called sites. Topics discussed in this section: Client (Browser) Server Uniform Resource Locator Cookies

3 Figure 27.1 Architecture of WWW

4 Browser (Client) Browser has three parts
Controller: receives input from keyboard or mouse and uses the client programs to access the document. Client program Interpreters: After the document has been accessed, the controller use one of the interpreters to display the document on the screen; HTML or Java.

5 Server The web page is stored at the server
Each time a client request arrives, the corresponding document is sent to the client To improve efficiency, servers normally store requested files in a cache in memory A server can also become more efficient through multithreading or multiprocessing

6 Figure URL The Uniform Resource Locator (URL) is a standard for specifying any kind of information on the Internet.

7 Cookies WWW designed to be stateless (no relationships between requests and responses, however, websites need other functions like: Allowing access to registered users Some Websites are used as electronic stores and need to keep track of shopping carts Some websites are used as portals Some websites need to advertise In order to achieve these functions, we need cookies that store information to maintain relations between requests and responses

8 HTML (Hypertext Markup Language) is a language for creating Web pages.
Static Documents Static Documents are fixed-content documents created and stored in a server. Clients can get only a copy of the documents. Clients use browser programs to display documents. HTML (Hypertext Markup Language) is a language for creating Web pages.

9 Figure 27.4 Static document

10 Figure Boldface tags

11 Figure 27.6 Effect of boldface tags

12 Figure 27.7 Beginning and ending tags

13 Dynamic Documents Dynamic Documents are created by a Web server whenever a browser requests the document. Web server runs application programs or scripts. Contents of dynamic documents vary from one request to another. Example: Retrieval of time and date from a server

14 Dynamic Documents CGI (Common Gateway Interface) is a technology that creates and handles dynamic documents. CGI is a set of standards defining how a dynamic document is written, how data are input to the program and how the output result is used. It allows programmers to use several languages like C, C++, Perl … etc CGI Inputs: Data in the URL or in a form. CGI Outputs: Text, HTML or variety of other things like pictures.

15 Figure 27.8 Dynamic document using CGI

16 Dynamic Documents Scripting Technology for Dynamic Documents
CGI is inefficient if part of the dynamic document is fixed and not changing from request to another. Example: In a spare part store, a part might have variable prices over time, but its picture and specification are more likely to stay fixed. Solution: Create fixed part of the document using HTML and embed a script. Many scripting languages are available, like Hypertext Processor (PHP), Java Server Pages (JSP), Active Server Pages (ASP) and others.

17 Figure 27.9 Dynamic document using server-site script

18 Active Documents are programs or scripts to be run at the client-site.
Example: Creation of animation at client side. Java Applets are programs written in Java on the server, compiled and ready for execution. It is in binary format. JavaScripts are scripts embedded -in source code format- into HTML documents to be executed at client-site.

19 Figure 27.10 Active document using Java applet

20 Figure 27.11 Active document using client-site script

21 It can jump from one document to another Functions like FTP and SMTP
HTTP Hypertext Transfer Protocol (HTTP) is used mainly to access data on the World Wide Web. It can jump from one document to another Functions like FTP and SMTP Transfers files and uses services of TCP; Uses TCP port 80 Transfer data between client and server HTTP information is read and interpreted by HTTP server and HTTP client

22 HTTP HTTP itself is a stateless protocol (doesn't maintain relationships between requests) Client initializes the transaction by sending a request message. Server replies by sending a response. Two types of HTTP messages Request Response Figure HTTP transaction

23 HTTP Messages Figure Request and response messages

24 Request and Status Lines
Figure Request and status lines

25 Request Type Table Methods

26 Status Code Table Status codes

27 Table 27.2 Status codes (continued)

28 Header Header exchanges additional information between the client and the server. Example: Client asking document to be sent in a special format, or the server send extra information about the document Figure Header format

29 Types of Headers General header provides general information about the message Can be present in both request and response messages Request header specifies client's configuration and preferred document format Can be present in request messages only Response header specifies server's configuration and special information about the request Can be present in response messages only Entity header gives information about the body of the document. Mostly present in response messages, but can appear in request messages too

30 Table 27.3 General headers

31 Table Request headers

32 Table 27.5 Response headers

33 Table Entity headers

34 Figure Example 27.1

35 Figure Example 27.2

36 Non-persistent Connection
HTTP prior to version 1.1 specified non-persistent connection, but persistent connection is the default in version In a non-persistent connection: One TCP connection is made for each request/response: Client opens TCP connection and sends a request Server sends the response and closes the connection Client reads data until EOF then closes connection For N different pics in different files, connection must be opened and closed N times High overhead on the server Server needs N different buffers and requires a slow start procedure

37 Persistent Connection
In a persistent connection: Server leaves the connection open for more requests after sending a response A server can close a connection at the request of a client or a time-out has been reached Server usually sends the length of the data with each response In case server doesn't know the length of data (e.g. if a document to be sent is created dynamically or actively) it will inform client that length is unknown and closes connection after sending all data, client at this case would know that the end of data has been reached.

38 Proxy Server HTTP supports proxy servers
A proxy server is a computer that keeps copies of responses to recent requests HTTP client sends a request to proxy server Proxy server checks its cache, if response is not stored, the proxy sends the request to the corresponding server Proxy servers reduce the load on original servers, they decrease traffic and improve latency Client must be configured to access the proxy server instead of target server

39 The end Important to do at home : - read chapter 27 of the textbook


Download ppt "WWW and HTTP King Fahd University of Petroleum & Minerals"

Similar presentations


Ads by Google