The Server Side
The Server Side Every Web site has listened to TCP port 80 for incoming corrections from clients normally browsers After the connection has been established the client sends one request and the server sends one reply. Then the connection is released. The protocol the defines the legal requests and replies is culled HTTP We will study it in some detail below, but a simple example using it may provide a reasonable idea of how Web servers work Figure 7-59 shows how the various parts of the Web model fit together For this example. we can mane that the us has clicked on some piece of text or perhaps icon that the puge whore naie URL-Uniform Resource Locator) httprww.w.rgfinvperiexi/WWWThe Preect l We will also explain URL et on in this chatte For the moment inte know that a URL has three dans the naTe of the protocol the n eol the machine where the page to located i n and the name of the can taining the page there we Prore. These that can be the user’s check and trade being displayed as
- The browser determines the URL in what was selected.
- The browser asK DNS for the IP address of www.w3.org
- DNS replies with 184.108.40.206
- The browser TC cont a tt snit: 18234125
- It then send a GET /hypertext/www/the project.html command.
- The www.w3.org server sends the file the project.html
- The TCP connection is released
- The browser displays all the text in TheProject.html.
- The browser fetches and displays all images in TheProject.html.
Many browsers display which step they are currently executing in a status line at the bottom of the screen. In this way, when the performance is poor, the user can see if it is due to DNS not responding, the server not responding, or simply network congestion during page transmission, It is worth noting that for each in-line image (icon, drawing, photo, eye.) on a page, the browser establishes a new TCP connection to the relevant server to fetch the image. Needles to say, if a page contains many icons, all on the same server. establishing, using and releasing a new connection for each one is not a wildly effienciant client, but it keeps the implementation simple. Future revisions of the protocol will address the efficiency issue. One proposal is given in Mogul, 1995) Because HTTP is an ASCII protocol like SMTP, it quite easy for a person at a terminal as opposed to a browser) to directly talk to Web servers, All that is needed is TCP connection to port 80 on the server: The simplest way to get such a connection is to use the Telnet program. Figure 7-60 shows a scenario of how this can be done. In this example, the lines marked C: are typed in by the user (client), the lines marked are produced by the Telnet program. and the lines marked are produced by the server at M.I.T.HOME