Presentation is loading. Please wait.

Presentation is loading. Please wait.

WWW & HTTP د. عـــادل يوسف أبو القاسم. W ORLD W IDE W EB ( WWW ) W 3 The World Wide Web (abbreviated as WWW or W3, commonly known as the web) is a system.

Similar presentations


Presentation on theme: "WWW & HTTP د. عـــادل يوسف أبو القاسم. W ORLD W IDE W EB ( WWW ) W 3 The World Wide Web (abbreviated as WWW or W3, commonly known as the web) is a system."— Presentation transcript:

1 WWW & HTTP د. عـــادل يوسف أبو القاسم

2 W ORLD W IDE W EB ( WWW ) W 3 The World Wide Web (abbreviated as WWW or W3, commonly known as the web) is a system of interlinked hypertext documents accessed via the Internet. With a web browser, one can view web pages that may contain text, images, videos, and other multimedia and navigate between them via hyperlinks.

3 A RCHITECTURE OF WWW

4 URL

5 WEB DOCUMENTS  تصنف ال documents في الويب الى ثلاثة اصناف هي static و dynamic و active.  هذا التصنيف يعتمد على الزمن الذي يتم فيه تحديد محتوى ال document.

6 S TATIC DOCUMENT

7 Boldface tags Effect of boldface tags

8 Dynamic document using CGI

9 Dynamic document using server-site script Dynamic documents are sometimes referred to as server-site dynamic documents

10 Active document using Java applet

11 Active document using client-site script Active documents are sometimes referred to as client-site dynamic documents

12 2: Application Layer 12 W EB &HTTP كل صفحة ويب تحتوي على مجموعة من ال objects. ال objects يمكن ان تكون HTML file, JPEG image, Java applet, audio file,… صفحة الويب تحتوي على base HTML-file يحتوي على عدد من ال objects الاخرى. كل objects له عنوان URL. Example URL: www.someschool.edu/someDept/pic.gif host name path name

13 13 HTTP HYPERTEXT TRANSFER PROTOCOL عبارة عن برتكول يعمل في طبقة التطبيق. The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. client/server model client: browser that requests, receives, “displays” Web objects server: Web server sends objects in response to requests PC running Explorer Server running Apache Web server Mac running Navigator HTTP request HTTP response

14 W EB COMMUNICATION Internet Get http://www.google.com/index.html HTTP Request: HTTP Reply Client: browser (Firefox) on local computer Web server: apache on www.google.com

15 HTTP VS HTML HTML: hypertext markup language Definitions of tags that are added to Web documents to control their appearance HTTP: hypertext transfer protocol The rules governing the conversation between a Web client and a Web server

16 16 HTTP OVERVIEW ( CONTINUED ) Uses TCP: ال clients يقوم بانشاء TCP connection لل server في ال port رقم 80. ال Server يقبل ال TCP connection التي وردت اليه من ال client. رسائل ال HTTP يتم تبادلها بين المتصفح ويعتبر HTTP client ومخدم الويب ويعتبر HTTP server بعد ذلك يتم اغلاق ال TCP connection

17 HTTP transaction

18 HTTP is “stateless”  ال server لا يحتوي علي اي معلومات للاتصالات السابقة لل clients.  البرتكولات من النوع statefull تعتبر معقدة, لأنه يجب ان يتم التعامل مع الاتصالات السابقة.  if server/client crashes, their views of “state” may be inconsistent, must be reconciled HTTP OVERVIEW ( CONTINUED )

19 19 HTTP CONNECTIONS 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

20 20 N ONPERSISTENT HTTP 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 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time

21 2: Application Layer 21 N ONPERSISTENT HTTP ( CONT.) 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects 4. HTTP server closes TCP connection. time

22 2: Application Layer 22 R ESPONSE TIME MODELING Definition of RTT: time to send a small packet to travel from client to server and back. Response time: one RTT 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 time to transmit file initiate TCP connection RTT request file RTT file received time

23 23 P ERSISTENT HTTP Nonpersistent HTTP issues: requires 2 RTTs per object OS must work and allocate host resources for each TCP connection but 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 are sent over connection Persistent without pipelining: client issues new request only when previous response has been received one RTT for each referenced object Persistent with pipelining: default in HTTP/1.1 client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects

24 2: Application Layer 24 HTTP REQUEST MESSAGE two types of HTTP messages: request, response HTTP request message: ASCII (human-readable format) 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) request line (GET, POST, HEAD commands) header lines Carriage return, line feed indicates end of message

25 27.25 R EQUEST AND RESPONSE MESSAGES

26 2: Appli catio n Layer 26 HTTP REQUEST MESSAGE : GENERAL FORMAT

27 Request and status lines

28 28 U PLOADING FORM INPUT 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: www.somesite.com/animalsearch?monkeys&banana

29 M ETHODS

30 Status codes

31 Status codes (continued)

32 2: Application Layer 32 HTTP RESPONSE MESSAGE 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... status line (protocol status code status phrase) header lines data, e.g., requested HTML file

33 27.33 Header format

34 27.34 General headers

35 27.35 Request headers

36 27.36 Response headers

37 27.37 Entity headers

38 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 the GIF or 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 Example(1)

39 27.39 Example

40 In this example, the client wants to send data to the server. We use the POST method. The request line shows the method (POST), URL, and HTTP version (1.1). There are four lines of headers. The request body contains the input information. The response message contains the status line and four lines of headers. The created document, which is a CGI document, is included as the body. Example(2)

41

42  ال cookie وتعرف ايضاً ب HTTP cookie أو web cookie او ال browser cookie هي عبارة عن small piece of data يتم ارسالها من موقع ويب وتخزن في ال browser اثناء تصفح المستخدم لذلك الموقع.  كل مرة يقوم فيها المستخدم بتحميل ذلك الموقع يقوم المتصفح بارسال ال cookie لل server ليتمكن من معرفة النشاطات السابقة للمستخدم. Cookies

43  على الرغم من ان ال cookies لا يمكنها نقل فيروسات ولا يمكنها تنزيل malware في جهاز المستخدم لكنها قد تساعد في عمليات تتبع المستخدم tracking حيث يمكنها معرفة history التصفح واستعراض المواقع بواسطة المستخدم.  Cookies can also store passwords and forms a user has previously entered, such as a credit card number or an address. Cookies Cont.

44 44 U SER - SERVER STATE : COOKIES Many major Web sites use cookies Four components: 1) cookie header line in the HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host and managed by user’s browser 4) back-end database at Web site Example: Susan access Internet always from same PC She visits a specific e- commerce site for first time When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID

45 45 C OOKIES : KEEPING “ STATE ” ( CONT.) client server usual http request msg usual http response + Set-cookie: 1678 usual http request msg cookie: 1678 usual http response msg usual http request msg cookie: 1678 usual http response msg cookie- specific action cookie- spectific action server creates ID 1678 for user entry in backend database access Cookie file amazon: 1678 ebay: 8734 Cookie file ebay: 8734 Cookie file amazon: 1678 ebay: 8734 one week later:

46 46 C OOKIES ( CONTINUED ) What cookies can bring: authorization shopping carts recommendations user session state (Web e- mail) Cookies and privacy: rcookies permit sites to learn a lot about you ryou may supply name and e-mail to sites rsearch engines use redirection & cookies to learn yet more radvertising companies obtain info across sites

47 47 W EB CACHES ( PROXY SERVER ) user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client Goal: satisfy client request without involving origin server client Proxy server client HTTP request HTTP response HTTP request HTTP response origin server origin server

48 2: Application Layer 48 M ORE ABOUT W EB CACHING Cache acts as both client and server Typically cache is installed by ISP (university, company, residential ISP) Why Web caching? Reduce response time for client request. Reduce traffic on an institution’s access link. Internet dense with caches enables “poor” content providers to effectively deliver content (but so does P2P file sharing)

49 2: Application Layer 49 C ONDITIONAL GET Goal: don’t send object if cache has up-to-date cached version cache: specify date of cached copy in HTTP request If-modified-since: server: response contains no object if cached copy is up-to- date: HTTP/1.0 304 Not Modified cache server HTTP request msg If-modified-since: HTTP response HTTP/1.0 304 Not Modified object not modified HTTP request msg If-modified-since: HTTP response HTTP/1.0 200 OK object modified

50 Thank You


Download ppt "WWW & HTTP د. عـــادل يوسف أبو القاسم. W ORLD W IDE W EB ( WWW ) W 3 The World Wide Web (abbreviated as WWW or W3, commonly known as the web) is a system."

Similar presentations


Ads by Google