DBs working on FILE-SERVER technology;
DBs working on CLIENT-SERVER technology.
File Server
- Access to the database (request)
- Transferring data with blocking access to other users
- Data processing on the user's computer
For clarity, consider concrete examples. Suppose you need to view sent payment orders for the period from May 19 to May 25 in the amount of 5,000 rubles. The user will need to launch a client application on his computer that works in the database with payment orders and enter the required selection criteria. After that, a file containing all documents of this type for the entire period for any amount will be downloaded to your computer from the database server and loaded into RAM. The client application running on the user's computer, working with the database, will itself process this information (sort them), after which it will issue an answer (a list of payment orders that meet your criteria will appear on the screen). After that, you will select the required payment order and try to edit (change) one field in it - for example, the date. During editing, the data source is locked, that is, the entire file containing this document. This means that the file will either not be available to other users at all, or will be available only in view mode. Moreover, this kind of capture does not even occur at the record level, that is, one document, but is blocked whole file- that is, the entire table containing similar documents. Only after this field is fully processed and the editing mode is exited, this file of payment orders will be unblocked from capture by the user. If the data is stored in more voluminous objects, for example, one file contains payment orders for both the receipt of funds and the sending, then even more information will not be available. You will work with one "date" field in one document - the rest of the employees of the enterprise will wait until you finish.
The disadvantages of the FILE-SERVER system are obvious:
Very heavy load on the network, increased bandwidth requirements. In practice, this makes it almost impossible simultaneous work a large number of users with large amounts of data.
Data processing is carried out on the user's computer. This entails increased requirements for the hardware of each user. How more users, topics more money will have to spend on equipping their computers.
Blocking data when editing by one user makes it impossible for other users to work with this data.
Security. To be able to work with such a system, you will need to give each user full access to the whole file, in which he may be interested in only one field.
client-server
Handling a single user request:
- Accessing the database (SQL query)
- Sending a response - the result of processing
If it is necessary to process the information stored in the database, the client application running on the user's computer that works with the database generates a query in the SQL language (the name from the initial letters is the Structured Query Language). The database server receives the request and processes it on its own. No data array (file) is transmitted over the network. After processing the request, only the result is transmitted to the user's computer - that is, in the previous example, a list of payment orders that meet the required criteria. The file itself, which stored the data that served as the source for processing, remains unlocked for access by the server itself at the request of other users.
In serious client-server DBMS, there are additional mechanisms, reducing the load on the network, reducing the requirements for user computers. As an example, let's take stored procedures - that is, entire programs for processing data stored in a database. In this case, even SQL expressions are not transmitted from the user to the server - a function call with call parameters is transmitted. In this way, workplace the user is simplified even more, the logic of the program is transferred to the server. The user place becomes just a means of displaying information. All this means a further reduction in the load on the network and user workstations.
Thus, all the above disadvantages of the FILE-SERVER scheme are eliminated in the CLIENT-SERVER architecture:
Data arrays are not transferred over the network from the database server to the user's computer. Network bandwidth requirements are reduced. This makes it possible for a large number of users to work simultaneously with large amounts of data.
Data processing is carried out on the database server, and not on the user's computer. This allows you to use simpler, and therefore cheaper computers at client sites.
Blocking (capture) of data by one user does not occur.
User access is provided not to the whole file, but only to those data from it with which the user has the right to work.
Having considered the difference between a FILE-SERVER and a CLIENT-SERVER, we can complete the consideration of the concept of "information storage". It is important to emphasize that the work depends largely on the type of DBMS used. corporate system. It is clear that for large enterprises, with big amount users, with a huge number of records in the database, the file-server scheme is completely unacceptable. On the other hand, there are differences in databases in other parameters and capabilities:
types of data that can be stored in the database (numbers, dates, text, pictures, video, sound, etc.);
on the technologies of access to data in the database organized by the database itself and the level of protection of information from unauthorized access;
on the provided tools and development methods that can be used to design any information system based on this database;
on the provided means and methods of information (data) analysis that can be applied in the information system based on this database;
by reliability and stability, that is (roughly) the number of records (filled fields) in the database, which provides a reliable and uninterrupted ability to access, change, analyze information in the database;
by speed - the time spent on accessing and processing information;
if possible, organize work on computers from different manufacturers, that is, according to compatibility with other platforms and operating systems;
by the level of support (service) provided by the database developer or its authorized dealer;
by availability good money creating applications that use this database, etc.
Why is it not profitable to invest in a file server solution today? Today the further way of development of databases is already obvious. Multi-level client-server systems appear, with very thin clients, removing any restrictions from client stations, both in terms of performance and platform, operating system. If for a client-server solution further development seems quite clear, and the transition from client-server to multi-level client-server is not problematic, then for a file server, a simple transition to client-server is a huge problem and enormous labor costs, if it suddenly turns out to be possible at all.
The client-server architecture is widely used network technologies used to access various network services. Let's take a quick look at some types of such services (and servers).
Web servers
Initially, they provided access to hypertext documents via the HTTP protocol (Huper Text Transfer Protocol). Now they support advanced features, in particular, working with binary files (images, multimedia, etc.).
Application servers
Designed for centralized solution of applied problems in a certain subject area. To do this, users have the right run server programs for execution. The use of application servers reduces client configuration requirements and simplifies general management network.
Database servers
Database servers are used to process user queries in the SQL language. In this case, the DBMS is located on the server, to which client applications connect.
File servers
File Server stores information in the form of files and provides users with access to it. As a rule, a file server also provides a certain level of protection against unauthorized access.
Proxy Server
First, it acts as an intermediary, helping users obtain information from the Internet while securing the network.
Secondly, it stores frequently requested information in a cache on a local disk, quickly delivering it to users without re-accessing the Internet.
Firewalls(firewalls)
Firewalls, analyzing and filtering the passing network traffic, in order to secure the network.
They provide services for sending and receiving electronic mail messages.
Servers remote access(RAS)
These systems provide communication with the network via dial-up lines. A remote employee can use corporate LAN resources by connecting to it using a regular modem.
These are just a few types of the entire variety of client-server technologies used in both local and global networks.
To access certain network services, clients are used, the capabilities of which are characterized by the concept of "thickness". It defines the hardware configuration and software that the customer has. Consider possible boundary values:
"Thin" client
This term defines a client whose computing resources are only sufficient to run the required network application through a web interface. The user interface of such an application is formed by means of static HTML (JavaScript execution is not provided), all application logic is performed on the server.
For the thin client to work, it is enough just to provide the ability to launch a web browser, in the window of which all actions are carried out. For this reason, the web browser is often referred to as the "universal client".
"Fat" client
This is a workstation or personal computer running its own disk operating system and having the necessary set of software. TO network servers"fat" clients apply mainly for additional services (for example, access to a web server or corporate database).
A “thick” client also means a client network application running under the local OS. Such an application combines a data presentation component (OS graphical user interface) and an application component (computing power of the client computer).
IN Lately Another term is increasingly used: "rich"-client. "Rich"-client is a kind of compromise between "thick" and "thin" client. Like the "thin" client, the "rich" client also presents a graphical interface, already described by means of XML and including some functionality of thick clients (for example, a drag-and-drop interface, tabs, multiple windows, drop-down menus, etc.)
The application logic of the “rich” client is also implemented on the server. The data is sent to standard format exchange, based on the same XML (SOAP, XML-RPC protocols) and interpreted by the client.
Some of the main XML-based rich client protocols are listed below:
- XAML (eXtensible Application Markup Language) - developed by Microsoft, used in applications on the .NET platform;
- XUL (XML User Interface Language) - a standard developed by the Mozilla project, used, for example, in an email client Mozilla Thunderbird or Mozilla browser Firefox;
- Flex- multimedia technology based on XML developed by Macromedia/Adobe.
Conclusion
So, the main idea of the client-server architecture is to divide the network application into several components, each of which implements a specific set of services. The components of such an application can run on different computers, performing server and/or client functions. This improves reliability, security and performance. network applications and the network in general.
Send your good work in the knowledge base is simple. Use the form below
Students, graduate students, young scientists who use the knowledge base in their studies and work will be very grateful to you.
Hosted at http://www.allbest.ru/
[Enter text]
Servers. Basic concepts of servers
Client-server model
Classification standard servers
List of used literature
Servers. Basic concepts of servers
Server (from English server, serving). Depending on the purpose, there are several definitions of the concept of a server.
1. Server (network) - a logical or physical network node serving requests to a single address and/or domain name (adjacent domain names), consisting of one or a system of hardware servers running one or a system of server programs
2. Server (software) - software that receives requests from clients (in the client-server architecture).
3. Server (hardware) - a computer (or special computer equipment) dedicated and / or specialized to perform certain service functions.
3. Server in information technology - software component computer system that performs service functions at the request of the client, providing him with access to certain resources.
The relationship of concepts. The server application (server) runs on a computer, also called a "server", while considering the network topology, such a node is called a "server". IN general case it may be that the server application is running on a normal workstation, or a server application running on server computer within the considered topology, it acts as a client (that is, it is not a server from the point of view of the network topology).
Client-server model
The concepts of server and client and the roles assigned to them form the software concept of "client-server". The client-server model is another approach to structuring the Operating System (OS). In a broad sense, the client-server model assumes the presence of a software component - a consumer of a service - a client, and a software component - a provider of this service - a server. The interaction between the client and the server is standardized so that the server can serve clients implemented in different ways and maybe by different manufacturers. At the same time, the main requirement is that they request the services of the server in a way that is understandable to him. The initiator of the exchange is usually the client, which sends a service request to the server, which is in the request pending state. The same software component can be a client for one type of service and a server for another type of service. The client-server model is rather a convenient conceptual tool for a clear representation of the functions of a particular program element in one situation or another than technology. This model is successfully used not only in the construction of the OS, but also at all levels of software, and in some cases has a narrower, specific meaning, while retaining, of course, all its common features. With regard to structuring the OS, the idea is to split it into several processes - servers, each of which performs a separate set of service functions - for example, memory management, creation or scheduling of processes. Each server runs in user mode. The client, which can be either another OS component or an application program, requests a service by sending a message to the server. The OS kernel (here called the microkernel), operating in privileged mode, delivers the message to the desired server, the server performs the operation, after which the kernel returns the results to the client using another message. To interact with the client (or clients, if simultaneous work with several clients is supported), the server allocates the necessary interprocess communication resources (shared memory, pipe, socket, etc.) and waits for requests to open a connection (or, in fact, requests for the provided service). Depending on the type of such resource, the server may serve processes within the same computer system or processes on other machines through data channels (eg, COM port) or network connections.
The format of client requests and server responses is defined by the protocol. Specifications open protocols are described by open standards, for example, Internet protocols are defined in RFC documents.
Depending on the tasks being performed, some servers, in the absence of service requests, may be idle waiting. Others may be doing some work (for example, collecting information), for such servers, working with clients may be a secondary task.
Classification of standard servers
Typically, each server serves one (or several similar) protocols, and servers can be classified according to the type of service they provide.
Universal servers are a special kind of server program that does not provide any services on its own. Instead, generic servers provide service servers with a simplified interface to IPC resources and/or unified client access to various services. There are several types of such servers:
inetd from English. internet super-server daemon IP service daemon - a standard tool on UNIX systems - a program that allows you to write TCP/IP servers (and network protocols other families) that work with the client through inetd redirected standard input and output streams (stdin and stdout).
RPC from English. Remote Procedure Call remote procedure call - server integration system in the form of procedures available for calling remote user through a unified interface. The interface invented by Sun Microsystems for its operating system (SunOS, Solaris; Unix system) is currently used by both most Unix systems and Windows.
Applied client-server technologies Windows:
(D-)COM (English (Distributed) Component Object Model) etc. - Allows one program to perform operations on data objects using the procedures of other programs. Initially this technology is intended for their "embedding and linking objects" (OLE English Object Linking and Embedding), but, in general, allows you to write wide range various application servers. COM works only within one computer, DCOM is available remotely via RPC.
Active-X - COM and DCOM extension for creating multimedia applications.
Generic servers are often used to write all sorts of information servers, servers that do not need any specific networking, servers that do not have any tasks other than serving clients. For example, regular console programs and scripts can act as servers for inetd.
Most internal and network specific Windows servers work through universal servers (RPC, (D-)COM).
Network services ensure the functioning of the network, for example, DHCP and BOOTP servers provide initialization of servers and workstations, DNS - translation of names into addresses and vice versa.
Tunneling servers (for example, various VPN servers) and proxy servers provide communication with a network that is not accessible by routing.
AAA and Radius servers provide a single network authentication, authorization and access logging.
Information Services. Information services include both the simplest servers reporting information about the host (time, daytime, motd), users (finger, ident), and monitoring servers, such as SNMP. Majority information services work through universal servers.
Time synchronization servers are a special type of information services - NTP, in addition to informing the client about the exact time, the NTP server periodically polls several other servers to correct their own time. In addition to time correction, the travel speed is analyzed and corrected. system clock. Time correction is carried out by speeding up or slowing down the system clock (depending on the direction of the correction) in order to avoid problems that can occur with a simple permutation of the time.
File servers are servers for providing access to files on the server's disk.
First of all, these are on-demand file transfer servers using FTP, TFTP, SFTP and HTTP protocols. The HTTP protocol is transfer-oriented text files, but servers can also give arbitrary data as requested files, for example, dynamically created web pages, pictures, music, etc.
Other servers allow you to mount server disk partitions in disk space client and fully work with files on them. The servers allow NFS protocols and SMB. NFS and SMB servers work through the RPC interface.
Disadvantages of a file server system:
Very heavy load on the network, increased bandwidth requirements. In practice, this makes it almost impossible for a large number of users to work with large amounts of data at the same time.
Data processing is carried out on the user's computer. This entails increased requirements for the hardware of each user. The more users, the more money will have to be spent on equipping their computers.
Blocking data when editing by one user makes it impossible for other users to work with this data.
Security. To be able to work with such a system, you will need to give each user full access to the whole file, in which he may be interested in only one field.
Data access servers maintain the database and return data upon request. One of the most simple servers of a similar type - LDAP (English Lightweight Directory Access Protocol - a lightweight protocol for accessing lists).
There is no single protocol for accessing database servers, however, all database servers are united by the use of uniform query generation rules - the SQL language (Structured Query Language).
Messaging services allow the user to send and receive messages (usually text messages).
Servers first. Email working on SMTP protocol. The SMTP server receives the message and delivers it to the user's local mailbox or to another SMTP server (destination or intermediate server). On multi-user computers, users work with mail directly on the terminal (or web interface). To work with mail on a personal computer, mail is retrieved from the mailbox through servers operating under the POP3 or IMAP protocols.
To organize conferences, there are news servers operating via the NNTP protocol.
For real-time messaging, there are chat servers, a standard chat server operates on the IRC protocol - a distributed chat for the Internet.
There are many other chat protocols, such as ICQ or Jabber.
Remote access servers
Remote access servers, through the appropriate client program, provide the user with console access to a remote system.
To provide access to the command line, telnet, RSH, SSH servers are used.
The graphical interface for Unix systems - X Window System, has a built-in remote access server, since it was originally developed with this capability. The ability to remotely access the X-Window interface is sometimes incorrectly referred to as "X-Server" (the X-Window term for a video driver).
The standard server for remote access to the Microsoft Windows GUI is called a terminal server.
Some kind of management (more precisely, monitoring and configuration) is also provided by the SNMP protocol. The computer or hardware device must have an SNMP server for this.
Game servers serve for the simultaneous game of several users in a single game situation. Some games have a server in the main distribution and allow you to run it in a non-dedicated mode (that is, they allow you to play on the machine on which the server is running).
Server solutions - operating systems and / or software packages optimized for the performance of server functions by a computer and / or containing a set of programs for the implementation of typical services.
An example of server solutions is Unix systems that were originally designed to implement a server infrastructure, or server modifications. Microsoft platforms Windows.
It is also necessary to separate packages of servers and related programs (for example, a web server / PHP / MySQL kit for a quick deployment of hosting) for installation under Windows (Unix is characterized by modular or "packaged" installation of each component, so such solutions are rare).
In integrated server solutions, all components are installed at the same time, all components are more or less tightly integrated and pre-configured with each other. However, in this case, replacing one of the servers or secondary applications (if their capabilities do not meet the needs) can be a problem.
Server solutions serve to simplify the organization of the basic IT infrastructure of companies, that is, to quickly build a full-fledged network in a company, including from scratch. Combining individual server applications into a solution implies that the solution is designed to perform most typical tasks; at the same time, the complexity of deployment and the total cost of ownership of an IT infrastructure built on such solutions is significantly reduced.
Proxy server (from the English proxy - “representative, authorized”) is a service in computer networks that allows clients to make indirect requests to other network services. First, the client connects to the proxy server and requests some resource (for example, e-mail) located on another server. The proxy then either connects to specified server and receives a resource from it, or returns a resource from its own cache (in cases where the proxy has its own cache). In some cases, a client request or server response can be modified by a proxy server in certain purposes. Also, a proxy server allows you to protect client computer from some network attacks.
Outputs
server formatProxy windows
Thus, any computer network, in fact, is a client-server network. A user who connects his computer to the Internet will be dealing with a client-server network, and even if the computer does not have access to the network, its software, and indeed it, is most likely organized according to the client-server scheme.
List of usesovannoyliterature
1. Droga A.A., Zhukova P.N., Koponev D.N., Lukyanov D.B., Prokopenko A.N. Computer science and mathematics. - Minsk, 2008.
2. Connolly T., Begg K. Databases. Design, implementation and support. Theory and Practice - 3rd ed. - M.: "Williams", 2003.
3. Kuznetsov S.D. Database fundamentals. - 1st ed. - M.: "Internet University of Information Technologies - INTUIT.ru", 2005.
4. Scott W. Ambler, Pramodkumar J. Sadalaj. Database refactoring: evolutionary design - M.: "Williams", 2007.
5. A.N. Morozevich, A.M. Zenevich Informatics. Minsk, 2008.
6. Titorenko G.A. Information technology management. M., Unity: 2002.
7. Melnikov V. Information security in computer systems. - M.: Finance and statistics, Electroninform, 1997.
Hosted on Allbest.ru
...Similar Documents
Basic concepts of servers. client-server model. Classification of standard servers. Disadvantages of a file server system. Cryptographic methods of information protection. Remote access servers. Methods and means of ensuring information security.
control work, added 12/13/2010
General information about the Linux operating system. Server information analysis. Basic applied client-server technologies of Windows. Information about the SQL server. General information about MySQL server. Installation and configuration specifics of the MYSQL server on LINUX.
term paper, added 12/16/2015
Analysis of the architecture of an information system, the structure of which includes the file-server and client-server systems. Comparison of SQL and QBE query languages. Principles for developing client-server architecture applications using structured language SQL queries.
term paper, added 04/11/2010
Architecture "client-server". System Analysis database "Newspaper of announcements", its infological and physical design. SQL Server Side Programming. Development of the client side in Borland C++ Builder 6.0 and using Web technologies.
term paper, added 07/07/2013
Methodology and main stages of developing a testing system for assessing the level of students' knowledge using the "Client-Server" technology. Designing the client, server part of this testing system, the procedure for compiling final reports.
thesis, added 11/08/2010
Designing physical and logical models of a remote database for gas stations. Development of a database in the Firebird DBMS using the IBExpert utility. Creation client application for Windows using client-server technology in the C++ Builder environment.
term paper, added 01/18/2017
Creation of a software product based on client-server technology that implements fault-tolerant operation of the system, which is capable of connecting the client to the master server in case of loss of communication alternative server(on the example of a weather server).
term paper, added 08/24/2012
Design and development of a database in the Firebird RDBMS. The sequence of creating an application based on client-server technology and running in the operating room Windows system. Stored procedures and triggers. Network access and transactions.
term paper, added 07/27/2013
Relational bases data as part of corporate information systems, their construction on the principles of client-server technology. Main characteristics of the Firebird DBMS. Designing a database for the information system "Computer components".
term paper, added 07/28/2013
Architecture "client-server". Parallel data processing in multiprocessor systems. Modernization of outdated information systems. Character traits modern server DBMS. The most popular server DBMS. Distributed requests and transactions.
The purpose of the lecture: to show how the general principles of client-server technologies are implemented in web technologies. Consider key elements basic HTTP protocol.
The subject of this course is the technologies of the global network World Wide Web (abbreviated as WWW or simply Web). In Russian, a common variant is the name "Web".
In particular, the course will cover such issues as: basic standards and protocols of the Web, markup and programming languages for web pages, tools for developing and managing web content and applications for the Web, tools for integrating web content and applications on the Web.
Net Web is a global information space based on the physical infrastructure of the Internet and the transmission protocol HTTP data. Often, when talking about the Internet, they mean the network. Web.
Client-server technologies Web
The basic protocol of the Web hypertext resource network is the HTTP protocol. It is based on interaction client-server", which means that:
Consumer- customer initiating a connection with the provider-server sends him a request;
The supplier- server, having received a request, performs the necessary actions and returns a response with the result back to the client.
In this case, there are two ways to organize the work of a client computer:
Thin client is a client computer that transfers all information processing tasks to the server. An example of a thin client is a browser-based computer used to run web applications.
fat client, on the contrary, it processes information independently of the server, uses the latter mainly for data storage.
Before moving on to specific client-server web technologies, let's look at the basic principles and structure of the underlying HTTP protocol.
http protocol
HTTP(HyperText Transfer Protocol - RFC 1945, RFC 2616) is an application layer protocol for transferring hypertext.
The central object in HTTP is resource, which points to URI in the client's request. Typically, these resources are files stored on the server. A feature of the HTTP protocol is the ability to specify in the request and response how the same resource is represented by various parameters: format, encoding, language, etc. It is thanks to the ability to specify how the message is encoded that the client and server can exchange binary data, although initially this protocol designed to convey symbolic information. At first glance, this may seem like a waste of resources. Indeed, data in symbolic form takes up more memory, messages create an additional load on communication channels, but this format has many advantages. Messages transmitted over the network are easy to read, and by analyzing the received data, the system administrator can easily find the error and fix it. If necessary, the role of one of the interacting applications can be performed by a person, manually entering messages in the required format.
Unlike many other protocols, HTTP is a memoryless protocol. This means that the protocol does not store information about previous client requests and server responses. Components using HTTP can independently maintain state information related to recent requests and responses. For example, a web client application that sends requests can keep track of response delays, and a web server can store the IP addresses and request headers of recent clients.
All software for working with the HTTP protocol is divided into three main categories:
Servers- providers of information storage and processing services (request processing).
Clients- end users of server services (sending requests).
Proxy servers to support transport services.
The "classic" HTTP session scheme looks like this.
Establishing a TCP connection.
Client request.
Server response.
Termination of the TCP connection.
Thus, the client sends a request to the server, receives a response from it, after which the interaction stops. Typically, a client request is a request for an HTML document or some other resource, and the server's response contains the code for that resource.
The HTTP request sent from the client to the server consists of the following components.
The status line (sometimes the terms status line, or query line are also used to refer to it).
Header fields.
Empty line.
Request body.
status bar together with header fields sometimes also called request header.
Rice. 1.1. The structure of the client's request.
Status bar has the following format:
query_method URL_pecypca protocol_version_HTTP
Let's take a look at the components of the status bar, with particular attention to the query methods.
Method, specified in the status bar, determines how to act on the resource whose URL is given in the same line. The method can take the values GET, POST, HEAD, PUT, DELETE, etc. Despite the abundance of methods, only two of them are really important for a web programmer: GET and POST.
GET. According to the formal definition, the GET method is intended to retrieve a resource with a specified URL. Having received GET request, the server MUST read the specified resource and include the resource ID in the response to the client. The resource whose URL is passed as part of the request does not have to be an HTML page, image file, or other data. The resource URL can point to the program's executable code, which, under certain conditions, must be run on the server. In this case, the client is returned not the program code, but the data generated during its execution. Although, by definition, the GET method is for retrieving information, it can be used for other purposes as well. The GET method is fine for passing small pieces of data to the server.
POST. According to the same formal definition, the main purpose of the POST method is to send data to the server. However, like the GET method, the POST method can be used in many ways and is often used to retrieve information from a server. As with the GET method, the URL given in the status bar points to a specific resource. The POST method can also be used to start a process.
The HEAD and PUT methods are modifications of the GET and POST methods.
HTTP protocol version is usually given in the following format:
HTTP/version.modification
Header fields, following the status line, allow you to refine the query, i.e. send additional information to the server. The header field has the following format:
Field_name: Value
The purpose of a field is determined by its name, which is separated from the value by a colon.
The names of some of the most common header fields in a client request and their purpose are given in tab. 1.1.
Table 1.1. HTTP request header fields. |
|
HTTP Request Header Fields |
Meaning |
Domain name or IP address of the host that the client is accessing |
|
The URL of the document that links to the resource specified in the status bar |
|
Email address user mail working with a client |
|
MIME types of data processed by the client. This field can have multiple values separated by commas. Often the Accept header field is used to tell the server which image file types the client supports. |
|
A set of comma-separated two-character identifiers that represent the languages supported by the client |
|
List of supported character sets |
|
MIME type of the data contained in the request body (if the request does not consist of a single header) |
|
The number of characters contained in the request body (if the request does not consist of a single header) |
|
Present if the client does not request the entire document, but only part of it |
|
Used to manage a TCP connection. If the field contains Close, it means that after processing the request, the server should close the connection. The Keep-Alive value suggests not to close the TCP connection so that it can be used for subsequent requests |
|
Client information |
In many cases, when working on the Web, there is no request body. When running CGI scripts, the data passed for them in a request can be placed in the body of the request.
Below is an example of an HTML request generated by a browser
GET http://oak.oakland.edu/ HTTP/1.0
Connection: Keep Alive
User Agent: Mozilla/4.04 (Win95; I)
Host: oak.oakland.edu
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Language: en
Accept-Charset: iso-8859-l,*,utf-8
Having received a request from the client, the server must respond to it. Knowing the structure of the server response is necessary for a web application developer, since programs that run on the server must independently form a response to the client.
Like a client request, a server response also has four components listed below.
Status bar.
Header fields.
Empty line.
Response body.
The server's response to the client begins with a status line that has the following format:
Protocol_version Response_code Explanatory_message
Protocol_version is specified in the same format as in the client's request and has the same meaning.
response_code is a three-digit decimal number that encodes the result of the request being served by the server.
explanatory_message duplicates the response code in symbolic form. This is a character string that is not processed by the client. It is intended for system administrator or an operator who maintains the system, and is the decoding of the response code.
Of the three digits that make up the response code, the first (highest) determines the response class, the remaining two represent the response number within the class. So, for example, if the request was processed successfully, the client receives the following message:
HTTP/1.0 200 OK
As you can see, the HTTP 1.0 protocol version is followed by the code 200. In this code, the character 2 means the successful processing of the client request, and the remaining two digits (00) are the number of this message.
In currently used implementations of the HTTP protocol, the first digit cannot be greater than 5 and defines the following response classes.
1 - a special class of messages called informational. A response code starting with 1 means that the server is continuing to process the request. When exchanging data between an HTTP client and an HTTP server, messages of this class are rarely used.
2 - successful processing of the client's request.
3 - request redirection. In order for the request to be served, additional steps must be taken.
4 - client error. As a rule, a response code starting with the number 4 is returned if the client's request met syntax error.
5 - server error. For one reason or another, the server is unable to fulfill the request.
Examples of response codes that the client can receive from the server, and explanatory messages are given in Table. 1.2.
Table 1.2. Server response code classes. |
||
Decryption |
Interpretation |
|
Part of the request has been accepted and the server is waiting for the client to continue the request |
||
The request was successfully processed, and the data specified in the request is transmitted in the client's response |
||
As a result of processing the request, a new resource was created |
||
The request has been accepted by the server, but processing has not been completed. Given code response does not guarantee that the request will be processed without errors. |
||
Partial content |
The server returns a portion of the resource in response to a request that contained a Range header field |
|
multiple choice |
The request points to more than one resource. The response body may contain instructions on how to properly identify the requested resource. |
|
Moved Permanently |
The requested resource is no longer located on the server |
|
Moved Temporarily |
The requested resource has temporarily changed its address |
|
Syntax error found in client request |
||
The resource on the server is not available for this user |
||
The resource specified by the client does not exist on the server |
||
Method Not Allowed |
The server does not support the method specified in the request |
|
Internal Server Error |
One of the server components is not working correctly |
|
Not Implemented |
The functionality of the server is not enough to fulfill the request of the client |
|
Service Unavailable |
Service temporarily unavailable |
|
HTTP Version not Supported |
The HTTP version specified in the request is not supported by the server |
The response uses the same header field structure as the client request. The header fields are intended to clarify the server's response to the client. A description of some of the fields that can be found in the server response header is given in Table. 1.3.
Table 1.3. Web server response header fields. |
|
Field name |
Description of content |
Server name and version number |
|
Time in seconds since the resource was created |
|
List of methods allowed for this resource |
|
Content-Language |
Languages that the client must support in order to correctly display the transmitted resource |
MIME-type of data contained in the body of the server response |
|
Number of characters contained in the server response body |
|
The date and time the resource was last modified |
|
The date and time that determines when the response was generated |
|
The date and time that defines the moment after which the information transmitted to the client is considered outdated |
|
This field specifies the actual location of the resource. It is used to redirect a request |
|
caching directives. For example, no-cache means the data should not be cached. |
The response body contains the code of the resource passed to the client in response to the request. It doesn't have to be the HTML text of the web page. As part of the response, an image, an audio file, a fragment of video information, as well as any other type of data supported by the client, can be transmitted. The content of the Content-type header field tells the client how to process the received resource.
The following is an example of a server response to the request in the previous section. The body of the response contains the source text of the HTML document.
Server: Microsoft-IIS/5.1
X-Powered-By: ASP.NET
Content-Type: text/html
Accept-Ranges: bytes
ETag: "b66a667f948c92:8a5"
Content Length: 426