CN Chapter 5
CN Chapter 5
Eg:URL http://www.mhhe.com/compsci/forouzan
Web Documents
The documents in the WWW can be grouped into three broad categories:
static, dynamic, and active.
Static documents are fixed-content documents that are created and stored
in a server. The client can get a copy of the document only.
The contents in the server can be changed, but the user cannot change them.
Static documents are prepared using one of several languages: HyperText
Markup Language (HTML), Extensible Markup Language (XML),
Extensible Style Language (XSL), and Extensible Hypertext Markup
Language (XHTML).
Dynamic Documents
Web Documents
The documents in the WWW can be grouped into three broad categories:
static, dynamic, and active.
Dynamic Documents
A dynamic document is created by a web server whenever a browser
requests the document.
When a request arrives, the web server runs an application program or a
script that creates the dynamic document.
Because a fresh document is created for each request, the contents of a
dynamic document may vary from one request to another.
Time and date are kinds of information that are dynamic in that they change
from moment to moment.
To prepare dynamic documents: Common Gateway Interface (CGI)(Used
earlier),today options include Java Server Pages (JSP), Active Server Pages
(ASP), ColdFusion(Embed SQL+HTTP)
Active Documents
For many applications, we need a program or a script to be run at the client
site. These are called active documents.
For example, suppose we want to run a program that creates animated
graphics on the screen or a program that interacts with the user.
When a browser requests an active document, the server sends a copy of the
document or a script.
The document is then run at the client (browser) site.
Methods to prepare such documents: Java applets and Java Scripts
File Transfer Protocol (FTP) is the standard protocol provided
by TCP/IP for copying a file from one host to another.
Some of concerns that should be considered before transferring
files: two systems may use different file name conventions, two
systems may have different ways of data representation, two
systems may have different directory structures.
All of these problems have been solved by FTP in a very simple
and elegant approach.
Although we can transfer files using HTTP, FTP is a better
choice to transfer large files or to transfer files using different
formats.
FTP
• Separation of commands and data transfer makes FTP more
efficient.
The two connections in FTP have different lifetimes.
The control connection remains connected during the entire
interactive FTP session.
The data connection is opened and then closed for each file
transfer activity.
It opens each time commands that involve transferring files are
used, and it closes when the file is transferred.
FTP uses two well-known TCP ports: port 21 is used for the
control connection, and port 20 is used for the data connection.
Communication is achieved through commands and responses.
During this control connection, commands are sent from the
client to the server and responses are sent from the server to the
client.
Every FTP command generates at least one response.
A response has two parts: a three-digit number followed by text.
The numeric part defines the code; the text part defines needed
parameters or further explanations.
The first digit defines the status of the command.
The second digit defines the area in which the status applies.
The third digit provides additional information.
Control Connection
Fig: Some FTP commands
Control Connection