SlideShare a Scribd company logo
1 of 46
TCP/IP Protocol Suite 1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 22
World Wide
Web
and
HTTP
TCP/IP Protocol Suite 2
OBJECTIVES:
 To discuss the architecture of WWW and describe the concepts
of hypertext and hypermedia.
 To describe Web clients and Web servers and their components.
 To define URL as a tool to identify a Web server.
 To introduce three different Web documents: static document,
dynamic document, and active document.
 To discuss HTTP and its transactions.
 To define and list the fields in a request message.
TCP/IP Protocol Suite 3
OBJECTIVES (continued):
 To define non-persistent and persistent connections in HTTP.
 To introduce cookies and their applications in HTTP.
 To discuss Web caching, its application, and the method used to
update the cache.
TCP/IP Protocol Suite 4
Chapter
Outline
22.1 Architecture
22.2 Web Document
22.3 HTTP
TCP/IP Protocol Suite 5
22-1 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. Each site
holds one or more documents, referred to as Web
pages. Each Web page, however, can contain some links
to other Web pages in the same or other sites. In other
words, a Web page can be simple or composite.
TCP/IP Protocol Suite 6
Topics Discussed in the Section
 Hypertext and Hypermedia
 Web Client (Browser)
 Web Server
 Uniform Resource Locator (URL)
TCP/IP Protocol Suite 7
Assume we need to retrieve a Web page that contains the
biography of a famous character with some pictures, which are
embedded in the page itself. Since the pictures are not stored as
separate files, the whole document is a simple Web page. It can be
retrieved using one single request/ response transaction, as shown
in Figure 22.1.
Example 22.1
TCP/IP Protocol Suite 8
Figure 22.1 Example 22.1
Request
1
Response 2
TCP/IP Protocol Suite 9
Now assume we need to retrieve a scientific document that
contains one reference to another text file and one reference to a
large image. Figure 22.2 shows the situation. The main document
and the image are stored in two separate files in the same site (file
A and file B); the referenced text file is stored in another site (file
C). Since we are dealing with three different files, we need three
transactions if we want to see the whole document. The first
transaction (request/response) retrieves a copy of the main
document (file A), which has a reference (pointer) to the second
and the third files.
Example 22.2
TCP/IP Protocol Suite 10
Figure 22.2 Example 22.2
Request 1
1
Response 1 2
Request 2
3
Response 2 4
Request 3
5
Response 3 6
TCP/IP Protocol Suite 11
A very important point we need to remember is that file A, file B,
and file C in Example 22.2 are independent Web pages, each with
independent names and addresses. Although references to file B or
C are included in file A, it does not mean that each of these files
cannot be retrieved independently. A second user can retrieve file
B with one transaction. A third user can retrieve file C with one
transaction.
Example 22.3
TCP/IP Protocol Suite 12
Figure 22.3 Browser
TCP/IP Protocol Suite 13
Figure 22.4 URL
TCP/IP Protocol Suite 14
22-2 WEB DOCUMENTS
The documents in the WWW can be grouped into three
broad categories: static, dynamic, and active. The
category is based on the time the contents of the
document are determined.
TCP/IP Protocol Suite 15
Topics Discussed in the Section
 Static Documents
 Dynamic Documents
 Active Documents
TCP/IP Protocol Suite 16
Figure 22.5 Static document
Request
1
Static document
2
TCP/IP Protocol Suite 17
HTML, XML, XSL, and XHTML are
discussed in Appendix E.
Note
TCP/IP Protocol Suite 18
Figure 22.6 Dynamic document using CGI
Request
1
Dynamic document
2
TCP/IP Protocol Suite 19
Figure 22.7 Dynamic document using server-site script
Request
1
Dynamic document
2
TCP/IP Protocol Suite 20
Dynamic documents are sometimes
referred to as server-site dynamic
documents.
Note
TCP/IP Protocol Suite 21
Figure 22.8 Active document using Java applet
Request
1
Result
Run the applet
to get the result
Active document
2
Applet
TCP/IP Protocol Suite 22
Figure 22.9 Active document using client-site script
Request
1
Run the JavaScript
(JS) to get the result
Result
2
JavaScript
JS
TCP/IP Protocol Suite 23
Active documents are sometimes
referred to as client-site dynamic
documents.
Note
TCP/IP Protocol Suite 24
22-3 HTTP
The Hypertext Transfer Protocol (HTTP) is a protocol
used mainly to access data on the World Wide Web.
HTTP functions like a combination of FTP (Chapter 21)
and SMTP (Chapter 23). It is similar to FTP because it
transfers files and uses the services of TCP. However,
it is much simpler than FTP because it uses only one
TCP connection. There is no separate control
connection; only data are transferred between the
client and the server.
TCP/IP Protocol Suite 25
Topics Discussed in the Section
 HTTP Transaction
 Conditional Request
 Persistence
 Cookies
 Web Caching: Proxy Server
 HTTP Security
TCP/IP Protocol Suite 26
HTTP uses the services of TCP on well-
known port 80.
Note
TCP/IP Protocol Suite 27
Figure 22.10 HTTP transaction
1
Request message
Request line
Headers
Body
A blank line
2
Response message
Status line
Headers
Body
A blank line
TCP/IP Protocol Suite 28
Figure 22.11 Format of the request message
TCP/IP Protocol Suite 29
TCP/IP Protocol Suite 30
TCP/IP Protocol Suite 31
Figure 22.12 Format of the response message
TCP/IP Protocol Suite 32
TCP/IP Protocol Suite 33
TCP/IP Protocol Suite 34
This example retrieves a document (see Figure 22.13). 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 22.4
TCP/IP Protocol Suite 35
Figure 22.13 Example 22.4
TCP/IP Protocol Suite 36
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 (see Figure 22.14).
Example 22.5
TCP/IP Protocol Suite 37
Figure 22.14 Example 22.5
TCP/IP Protocol Suite 38
HTTP uses ASCII characters. The following shows how a client can
directly connect to a server using TELNET, which logs into port 80.
Example 22.6
TCP/IP Protocol Suite 39
The following shows how a client imposes the modification data
and time condition on a request.
Example 22.7
The status line in the responds shows the file is not modified after
the defined point of time. The body of the response message is
also empty.
TCP/IP Protocol Suite 40
Figure 22.15 shows an example of a nonpersistent connection. The
client needs to access a file that contains two links to images. The
text file and images are located on the same server.
Example 22.8
TCP/IP Protocol Suite 41
Figure 22.15 Example 22.8
TCP/IP Protocol Suite 42
HTTP version 1.1 specifies a persistent
connection by default.
Note
TCP/IP Protocol Suite 43
Figure 22.16 shows the same scenario as Example 22.8, but using
persistent connection.
Example 22.9
TCP/IP Protocol Suite 44
Figure 22.16 Example 22.9
TCP/IP Protocol Suite 45
Figure 22.17 shows a scenario in which an electronic store can
benefit from the use of cookies. Assume a shopper wants to buy a
toy from an electronic store named BestToys. The shopper
browser (client) sends a request to the BestToys server.
Example 22.10
TCP/IP Protocol Suite 46
Figure 22.17 Example 22.10
A customer file is
created with ID: 12343
Request
GET BestToys.com HTTP/1.1
1
Response
HTTP/1.1 200 OK
Set-Cookie: 12343
Page Representing the Toys
2
A vendor file is created
with cookie: 12343
Update
3
Request
GET image HTTP/1.1
Response
Cookie: 12343
Cookie
4
HTTP/1.1 200 OK
Page Representing the price
Update
5
Request
GET image HTTP/1.1
Cookie: 12343
Information about the payment
Cookie
6
Response
HTTP/1.1 200 OK
Order confirmation
Update

More Related Content

Similar to Chap-22.ppt (20)

Chap 02 osi model
Chap 02 osi modelChap 02 osi model
Chap 02 osi model
 
transfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imaptransfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imap
 
Chap 12 tcp
Chap 12 tcpChap 12 tcp
Chap 12 tcp
 
Chap 12 tcp
Chap 12 tcpChap 12 tcp
Chap 12 tcp
 
Ch27
Ch27Ch27
Ch27
 
27 WWW and_HTTP
27 WWW and_HTTP27 WWW and_HTTP
27 WWW and_HTTP
 
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
Web Protocol Future (QUIC/SPDY/HTTP2/MPTCP/SCTP)
 
Ftp
FtpFtp
Ftp
 
Protocol Ppt[1]
Protocol Ppt[1]Protocol Ppt[1]
Protocol Ppt[1]
 
ch27-www-and-http.ppt
ch27-www-and-http.pptch27-www-and-http.ppt
ch27-www-and-http.ppt
 
IRJET- An Overview of Web Sockets: The Future of Real-Time Communication
IRJET- An Overview of Web Sockets: The Future of Real-Time CommunicationIRJET- An Overview of Web Sockets: The Future of Real-Time Communication
IRJET- An Overview of Web Sockets: The Future of Real-Time Communication
 
Networking in python by Rj
Networking in python by RjNetworking in python by Rj
Networking in python by Rj
 
ch02.ppt
ch02.pptch02.ppt
ch02.ppt
 
Ch2 application layer Network
Ch2 application layer NetworkCh2 application layer Network
Ch2 application layer Network
 
Chap 02
Chap 02Chap 02
Chap 02
 
Ch02 network models-jdb
Ch02 network models-jdbCh02 network models-jdb
Ch02 network models-jdb
 
Lec2_CH02.PPT
Lec2_CH02.PPTLec2_CH02.PPT
Lec2_CH02.PPT
 
2.(3)OSI and TCP layer.ppt
2.(3)OSI and TCP layer.ppt2.(3)OSI and TCP layer.ppt
2.(3)OSI and TCP layer.ppt
 
Appl layer
Appl layerAppl layer
Appl layer
 
OSI MODEL
OSI MODELOSI MODEL
OSI MODEL
 

Recently uploaded

办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一F La
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 

Recently uploaded (20)

办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 

Chap-22.ppt

  • 1. TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP
  • 2. TCP/IP Protocol Suite 2 OBJECTIVES:  To discuss the architecture of WWW and describe the concepts of hypertext and hypermedia.  To describe Web clients and Web servers and their components.  To define URL as a tool to identify a Web server.  To introduce three different Web documents: static document, dynamic document, and active document.  To discuss HTTP and its transactions.  To define and list the fields in a request message.
  • 3. TCP/IP Protocol Suite 3 OBJECTIVES (continued):  To define non-persistent and persistent connections in HTTP.  To introduce cookies and their applications in HTTP.  To discuss Web caching, its application, and the method used to update the cache.
  • 4. TCP/IP Protocol Suite 4 Chapter Outline 22.1 Architecture 22.2 Web Document 22.3 HTTP
  • 5. TCP/IP Protocol Suite 5 22-1 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. Each site holds one or more documents, referred to as Web pages. Each Web page, however, can contain some links to other Web pages in the same or other sites. In other words, a Web page can be simple or composite.
  • 6. TCP/IP Protocol Suite 6 Topics Discussed in the Section  Hypertext and Hypermedia  Web Client (Browser)  Web Server  Uniform Resource Locator (URL)
  • 7. TCP/IP Protocol Suite 7 Assume we need to retrieve a Web page that contains the biography of a famous character with some pictures, which are embedded in the page itself. Since the pictures are not stored as separate files, the whole document is a simple Web page. It can be retrieved using one single request/ response transaction, as shown in Figure 22.1. Example 22.1
  • 8. TCP/IP Protocol Suite 8 Figure 22.1 Example 22.1 Request 1 Response 2
  • 9. TCP/IP Protocol Suite 9 Now assume we need to retrieve a scientific document that contains one reference to another text file and one reference to a large image. Figure 22.2 shows the situation. The main document and the image are stored in two separate files in the same site (file A and file B); the referenced text file is stored in another site (file C). Since we are dealing with three different files, we need three transactions if we want to see the whole document. The first transaction (request/response) retrieves a copy of the main document (file A), which has a reference (pointer) to the second and the third files. Example 22.2
  • 10. TCP/IP Protocol Suite 10 Figure 22.2 Example 22.2 Request 1 1 Response 1 2 Request 2 3 Response 2 4 Request 3 5 Response 3 6
  • 11. TCP/IP Protocol Suite 11 A very important point we need to remember is that file A, file B, and file C in Example 22.2 are independent Web pages, each with independent names and addresses. Although references to file B or C are included in file A, it does not mean that each of these files cannot be retrieved independently. A second user can retrieve file B with one transaction. A third user can retrieve file C with one transaction. Example 22.3
  • 12. TCP/IP Protocol Suite 12 Figure 22.3 Browser
  • 13. TCP/IP Protocol Suite 13 Figure 22.4 URL
  • 14. TCP/IP Protocol Suite 14 22-2 WEB DOCUMENTS The documents in the WWW can be grouped into three broad categories: static, dynamic, and active. The category is based on the time the contents of the document are determined.
  • 15. TCP/IP Protocol Suite 15 Topics Discussed in the Section  Static Documents  Dynamic Documents  Active Documents
  • 16. TCP/IP Protocol Suite 16 Figure 22.5 Static document Request 1 Static document 2
  • 17. TCP/IP Protocol Suite 17 HTML, XML, XSL, and XHTML are discussed in Appendix E. Note
  • 18. TCP/IP Protocol Suite 18 Figure 22.6 Dynamic document using CGI Request 1 Dynamic document 2
  • 19. TCP/IP Protocol Suite 19 Figure 22.7 Dynamic document using server-site script Request 1 Dynamic document 2
  • 20. TCP/IP Protocol Suite 20 Dynamic documents are sometimes referred to as server-site dynamic documents. Note
  • 21. TCP/IP Protocol Suite 21 Figure 22.8 Active document using Java applet Request 1 Result Run the applet to get the result Active document 2 Applet
  • 22. TCP/IP Protocol Suite 22 Figure 22.9 Active document using client-site script Request 1 Run the JavaScript (JS) to get the result Result 2 JavaScript JS
  • 23. TCP/IP Protocol Suite 23 Active documents are sometimes referred to as client-site dynamic documents. Note
  • 24. TCP/IP Protocol Suite 24 22-3 HTTP The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. HTTP functions like a combination of FTP (Chapter 21) and SMTP (Chapter 23). It is similar to FTP because it transfers files and uses the services of TCP. However, it is much simpler than FTP because it uses only one TCP connection. There is no separate control connection; only data are transferred between the client and the server.
  • 25. TCP/IP Protocol Suite 25 Topics Discussed in the Section  HTTP Transaction  Conditional Request  Persistence  Cookies  Web Caching: Proxy Server  HTTP Security
  • 26. TCP/IP Protocol Suite 26 HTTP uses the services of TCP on well- known port 80. Note
  • 27. TCP/IP Protocol Suite 27 Figure 22.10 HTTP transaction 1 Request message Request line Headers Body A blank line 2 Response message Status line Headers Body A blank line
  • 28. TCP/IP Protocol Suite 28 Figure 22.11 Format of the request message
  • 31. TCP/IP Protocol Suite 31 Figure 22.12 Format of the response message
  • 34. TCP/IP Protocol Suite 34 This example retrieves a document (see Figure 22.13). 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 22.4
  • 35. TCP/IP Protocol Suite 35 Figure 22.13 Example 22.4
  • 36. TCP/IP Protocol Suite 36 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 (see Figure 22.14). Example 22.5
  • 37. TCP/IP Protocol Suite 37 Figure 22.14 Example 22.5
  • 38. TCP/IP Protocol Suite 38 HTTP uses ASCII characters. The following shows how a client can directly connect to a server using TELNET, which logs into port 80. Example 22.6
  • 39. TCP/IP Protocol Suite 39 The following shows how a client imposes the modification data and time condition on a request. Example 22.7 The status line in the responds shows the file is not modified after the defined point of time. The body of the response message is also empty.
  • 40. TCP/IP Protocol Suite 40 Figure 22.15 shows an example of a nonpersistent connection. The client needs to access a file that contains two links to images. The text file and images are located on the same server. Example 22.8
  • 41. TCP/IP Protocol Suite 41 Figure 22.15 Example 22.8
  • 42. TCP/IP Protocol Suite 42 HTTP version 1.1 specifies a persistent connection by default. Note
  • 43. TCP/IP Protocol Suite 43 Figure 22.16 shows the same scenario as Example 22.8, but using persistent connection. Example 22.9
  • 44. TCP/IP Protocol Suite 44 Figure 22.16 Example 22.9
  • 45. TCP/IP Protocol Suite 45 Figure 22.17 shows a scenario in which an electronic store can benefit from the use of cookies. Assume a shopper wants to buy a toy from an electronic store named BestToys. The shopper browser (client) sends a request to the BestToys server. Example 22.10
  • 46. TCP/IP Protocol Suite 46 Figure 22.17 Example 22.10 A customer file is created with ID: 12343 Request GET BestToys.com HTTP/1.1 1 Response HTTP/1.1 200 OK Set-Cookie: 12343 Page Representing the Toys 2 A vendor file is created with cookie: 12343 Update 3 Request GET image HTTP/1.1 Response Cookie: 12343 Cookie 4 HTTP/1.1 200 OK Page Representing the price Update 5 Request GET image HTTP/1.1 Cookie: 12343 Information about the payment Cookie 6 Response HTTP/1.1 200 OK Order confirmation Update