WWW Service Mechanism
Mechanism of WWW service
The WWW service operates on a client/server mechanism. On the WWW server side on the Internet, the http daemon is running and waiting. The browser on the client side enables browsing of homepages by communicating with this http daemon.
For communication, a protocol called HTTP (Hyper Text Transfer Protocol) that runs on TCP/IP is used.
Using HTTP, resources specified by URI (Uniform Resource Identifiers) notation (URL is also a type of this notation) can be exchanged between clients and servers.
The flow of communication between the server side and the client side is shown in the figure below.
①Request to send HTML data by specifying URL
On the client side, specify the URL of the homepage you want to browse. A request to send HTML data is then sent to the http daemon waiting on the server side.
②Send relevant HTML data
The WWW server sends the relevant HTML data to the requesting client.
(3) Interpret the HTML data and display it on the browser
A browser that receives HTML data interprets the HTML text and displays the page on the browser. Since different browsers have slightly different interpretations, the display will be slightly different depending on the browser type.
WWW service generally uses port number 80 of TCP, but it is also possible to change the port number for operation. However, if you change the port number, people who do not know it will not be able to receive the WWW service.
Communication between browser and HTTP server (part 1)
The communication with the HTTP server is as follows.
①Specify URL
(2) HTTP request message
GET / HTTP/1.1 Accept: */* Accept-Language: en UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1) Host: www.google.co.jp Connection: Keep-Alive Cookie: PREF=ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
● Request format
method pathname HTTP/version
Path name ・・・ Normally, a path name starting with a slash such as /aaa/bbb.html or a URL starting with http:// is specified.
Version ・・・ 1.1 is the mainstream
③ Identify the file
④HTTP response message
HTTP/1.1 200 OK Cache-Control: private, max-age=0 Date: Thu, 15 Jan 2009 14:49:03 GMT Expires: -1 Content-Type: text/html; charset=UTF-8 Content-Encoding: gzip Server: gws Content-Length: 4175 |
● Response format
HTTP/Version Status number Supplementary message
Supplementary message — “OK”, “Not Found”, etc. Returns a message that supplements the meaning and details of the status number.
(5) HTML display
Communication between browser and HTTP server (part 2)
A website consists not only of text but also various files such as image files and audio files.
HTTP is a simple protocol and has no mechanism to maintain state, such as which file is being downloaded. This is called stateless.
Therefore, as shown in the figure below, browsers and WWW servers exchange data for the same number of files that make up the homepage.
●HTTP/1.1
In this case, it cannot be said that the communication is highly efficient. Therefore, in HTTP/1.1 published in 1999, a function called pipeline was added to reduce communication delays by transferring the next request before the transfer of the previous request was completed.
Instead of disconnecting each time, the connection is maintained at the TCP/IP level, and the next request is processed continuously, thereby improving the display speed of the homepage.
●HTTP/2
Homepage content has become more complex, and HTTP/1.1 has caused delays in displaying the home page. In order to improve communication efficiency, HTTP/2, which was released in 2015, made it possible to process multiple requests at any given time.
In addition, we have added several functions such as header compression and priority setting of transferred content to improve the display speed of the homepage. But even the seemingly perfect HTTP/2 has its challenges.
WWW server type
There are various types of WWW service programs, as shown in the table below. A server that installs this WWW service program and starts the service is a WWW server.
The user does not have to worry about which service program the WWW server is using when browsing the homepage. No special browser settings are required.
OS | WWW service program name |
Windows95,98 | Personal Web Server |
Windows NT Workstation | Peer Web Server |
Windows NT Server | Internet Information Server (IIS) |
Windows 2000, Windows XP Professional, Windows Server 2003, Windows Vista, Windows Server 2008 Windows Server 2012 | Internet Information Services (IIS) |
Linux, Windows family | Apache HTTP Server |
The Windows family of operating systems has a WWW service program. You can use the Internet server service by installing from the CD-ROM.
*However, in the case of the WWW service program that comes with the client OS, the number of connections to the WWW service and the enhanced functions cannot be used.
“Apache HTTP Server” that can be used on Linux and Windows family OS can be obtained free of charge from the URL below.
Apache is free software that is being developed by volunteers all over the world and is open to the public free of charge. Used by many websites around the world.