Illustration HTTP,

Source: Internet
Author: User

Illustration HTTP,

HTTP is usually translated into hypertext transfer protocol, but this method is not rigorous. The rigorous translation should be "Hypertext Transfer Protocol ".

Basic Network TCP/IP:

There are a variety of contents in the Protocol:

From the cable specification to the selection of IP addresses, the method for finding remote users, the order in which both parties establish communications, and the Web page display requirements

The process.

 

IP protocol for transmission:

The IP (Internet Protocol) Protocol is located at the network layer.

Some may confuse "IP" with "IP address". "IP" is actually a protocol name.

The IP protocol is used to send various packets to the other party. To ensure that the data is transmitted to the other party, various conditions must be met. Two important conditions are the IP Address and the MAC Address ).

The IP address indicates the address allocated to the node, and the MAC address indicates the fixed address to which the NIC belongs. The IP address can be paired with the MAC address. The IP address can be changed, but the MAC address is basically not changed.

Use ARP to communicate with each other based on the MAC address. The communication between IP addresses depends on the MAC address.

ARP is a protocol used to parse an address. Based on the IP address of the Communication Party, the corresponding MAC address can be retrieved.

TCP protocol to ensure reliability:

By layer, TCP is located at the transport layer, providing reliable byte stream service.

In a word, the TCP protocol splits the data (packet segment) for easier transmission of big data, and can confirm whether the data is finally sent to the other party (three-way handshake policy ).

DNS service responsible for domain name resolution:

The DNS (Domain Name System) service is located at the application layer like the HTTP protocol.

Protocol. It provides resolution services between domain names and IP addresses. A computer can be either assigned an IP address or a host name or domain name.

 

The DNS Protocol provides the service of querying the IP address through the domain name or reverse querying the domain name from the IP address.

IP protocol, TCP protocol, and DNS service in use

What roles does HTTP play in communication:

 

Use Cookie status management:

HTTP is a stateless protocol that does not manage the status of previous requests and responses. That is to say, the request cannot be processed according to the previous status.

Encoding improves transmission rate:

HTTP can directly transmit data according to the original data, but it can also improve the transmission rate through encoding during transmission. It can effectively process a large number

. However, the encoding operation requires the computer to complete, so it will consume more resources such as CPU.

Segmented Transmission Encoding:

In the HTTP Communication Process, the browser cannot display the request page before the Request Encoding entity resources are fully transmitted. When transferring large-capacity data, you can split the data into multiple parts so that the browser can gradually display the page.

The function of Chunked TransferCoding is called the entity block function ).

The multipart Transfer Encoding divides the entity into multiple parts (blocks ). Each part uses sixteen

To mark the block size, and the last part of the entity uses "0 (CR + LF)" to mark

Note.

The entity that uses the Block Transfer Encoding will be decoded by the receiving client and restored to the encoding.

The entity before the code.

HTTP/1.1 has a mechanism called Transfer encoding.

It is transmitted in a certain encoding mode during communication, but only defined to act on the Block Transmission Encoding.

 

Request to obtain the range of some content:

If the server cannot respond to a range request, Status Code 200 OK and complete object content are returned.

 

Content negotiation returns the most appropriate content:

 

 

The agent has multiple usage methods, which are classified by two benchmarks. One is whether the cache is used, and the other

Whether the message will be modified.

 

The gateway can improve the communication security, because the communication between the client and the gateway can be

Line encryption to ensure connection security. For example, the gateway can connect to the database and use

SQL statement to query data. In addition, during credit card settlement on the Web shopping website,

The gateway can interact with the credit card settlement system.

 

 

Table 6-2: request header field

Non-HTTP/1.1 header fields:

Header fields used in HTTP Communication are not limited to 47 header fields defined in rfc2616. There are also cookies, Set-cookies, and Content-Disposition.

And other header fields defined in other RFC, they are frequently used.

These informal Header fields are summarized in RFC4229 HTTP Header FieldRegistrations.

HTTP protocol does not have an encryption mechanism, so it is easy to be stolen and tampered.

 

HTTP + encryption + Authentication + Integrity Protection = HTTPS

HTTPS also has some problems, that is, when SSL is used, its processing speed

It slows down.

Confirm access user identity authentication:

HTTP-based function append protocol:

1. Both Ajax and Comet communication have not solved the problem of the HTTP protocol itself.

2. SPDY

Does SPDY eliminate Web bottlenecks?

Because SPDY only multiplexing communications between a single domain name (IP address), when resources under multiple domain names are used on a Web site, the improvement effect will be limited.

.

SPDY is indeed a technology that can effectively eliminate HTTP bottlenecks, but many Web websites do not only have problems caused by HTTP bottlenecks. Improving the speed of the Web itself

You should also start from other areas that can be carefully studied, such as improving the way Web content is written.

 

3. Use WebSocket

WebSocket is the full-duplex communication standard between Web browsers and Web servers.

Specifically, the WebSocket protocol is set as the standard by IETF, And the WebSocket API is set as the standard by W3C

Standard. The WebSocket technology in development is mainly used to solve Ajax and Comet problems.

Problems caused by defects attached to XMLHttpRequest.

Once a WebSocket protocol communication connection is established between the Web server and the client,

All subsequent communications will rely on this dedicated protocol. Mutual transmission is allowed during communication

JSON, XML, HTML, or image data in any format.

Because the protocol is based on HTTP, the initiator of the connection is still the client,

Once a WebSocket communication connection is established, either side of the server or client

Messages can be sent directly to the other party.

Main features:

Push function, reduce traffic

To implement WebSocket communication, after an HTTP connection is established

Handshaking step.

The HTTP Upgrade header is used to implement WebSocket communication.

To change the server communication protocol.

Seven HTTP/2.0 technologies and discussions:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.