Graphic HTTP notes (a) - Understanding Web and network infrastructure

In this chapter: Web technology builds on what, how HTTP protocol birth and development?

A, Web-based HTTP communication

Web usage called HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol) protocol as a standard, the agreement refers to the agreement of some of the rules. It can be said is based on the HTTP Web protocol communication.

Two, HTTP birth

2.1 Background birth

This section is mainly about the birth of background HTTP, to understand the birth of background HTTP protocol will help us learn to understand the HTTP protocol.

httpbackground

HTTP at first birth is to share knowledge, the basic idea originally conceived by means of hypertext linkages between multi-document form, even to each other can be found in the WWW (World Wide Web, the World Wide Web).

Now we proposed to build three technologies:

  • The SGML, namely Standard Generalized Markup Language(Standard Generalized Markup Language) as a page of text markup language HTML (HyperText Markup Language, HTML);
  • As HTTP file transfer protocol;
  • URL address where the designated document (Uniform Resource Location, uniform resource locator).

Can be seen above three constitute knowledge sharing content (HTML), the way of knowledge sharing (HTTP transmission) and knowledge sharing location.

The slow development of HTTP 2.2

HTTP/0.9

HTTP was born in 1990 year at this time as an official standard yet, this time before the HTTP contain HTTP / 1.0 version of the meaning, so to be HTTP / 0.9.

HTTP/1.0

In May 1996 , HTTP is used as the official standard version is named HTTP / 1.0.

HTTP/1.1

January 1997 issued a HTTP / 1.1 version, is still the mainstream of the HTTP protocol.

Thus, as a Web document transfer protocol HTTP protocol version updates very slowly, a new generation of HTTP 2.0 is still under development, but to cover a large scale, but also take time.

HTTP 2.0

What significant improvements HTTP / 2.0 1.0 have compared?

HTTP protocol at first birth is to solve the problem of transmission of text, now beyond the boundaries of Web use in many scenarios.

2.3 Networking Basics TCP / IP

To communicate between computers, you need based on the same methods, such as how to detect the target, which side first initiates communication, what language communication, when the end of communication and so on. All of this requires prior agreement is good, so the rules of engagement are called protocol (protocol).

One theory is that TCP / IP refers to two protocols TCP and IP, another way of saying that refers to the IP protocol suite in the process of communication protocol used in the same say, the book biased in favor of the latter argument.

2.3.1 TCP / IP hierarchical management

TCP / IP protocol suite is the most important point is that hierarchical management, in general, divided into four layers: the application layer, transport layer, network layer and the data link layer.

The greatest benefit is that the hierarchical management of data transmission various stages of isolation decoupling, when similar modular programming. Application of a layer in the layer only needs to consider the need to complete the task, but do not control other unwanted things. This is done so that the layers of protocol implementations also became free, when you want to modify a layer protocols, only need to modify the layer protocol that does not involve other levels of agreement.

The role of each layer as follows:

  • The application layer , communication activities decided upon application services to users. HTTP, FTP (File Transfer Protocol, File Transfer Protocol) and DNS (Domain Name System, Domain Name System) belong to this layer.
  • Transport layer , a layer with respect to the application layer which provides the two computers in a data transmission network connection. The main layer protocol is TCP (Transmission Control Protocol) and UDP (User Data Protocol).
  • Network layer for processing data packets flowing on the network (the minimum unit of data transfer), the layer is predetermined by the computer how to reach the other side of the path, and transmits the data to each other. The main layer protocol is IP protocol and ARP (Address Solution Protocol) protocol.
  • The link layer , the network connection section for processing hardware, including an operating system, device drivers, etc., are visible on the hardware substantially in the range of the link layer. This layer protocol is Ethernet protocol (Ethernet).

More details about the network of stratified: https://www.cnblogs.com/DM428/p/7029467.html

2.3.2 TCP / IP communication transmission stream

httpstream

When using TCP / IP communication, it will be communicated with each other through a hierarchical order. Sender to go down from the data stream, the receiving side data flow away from the bottom up.

In each layer transmission process, the data will be boxing and unboxing. When the sender transmits data, the application layer is added in the HTTP HTTP transport header, the transport layer in the TCP transport header added in the Ethernet link layer header is added. The receiver receives the data transmission at the link layer, and from the lower layer to the upper layer begins unpacking. Removed layer by layer header, the last remaining data sender originally sent. When reaching the application layer even if the data has actually received the transmitted client.

httptransfer

This information is packaged data is called encapsulation method (encapsulate).

2.3.3 HTTP concerned with a close agreement: IP, TCP and DNS

IP protocol

IP protocol for network transmission in the network layer. IP is not the IP address, we usually say IP is a protocol. Indicates the IP address is assigned to the address of the node, the MAC address is a fixed address belongs to the network card, each card when shipped, the world has a unique MAC address, length of 48 bits, with 12 bits hexadecimal number indicates. IP address and MAC address pair, but the same machine may become an IP address, MAC is fixed.

IP 间的通信依赖 MAC 地址,实际生活中同一局域网内的网络通信比较少,大部分都是广域网的通信,数据需要经过多个节点路由的转发才能到达目的地。而在中转时,会利用下一站中转设备的 MAC 地址来搜索下一个中转目标。这时会采用 ARP 协议(Address Resolution Protocol),根据对方的 IP 地址即可查出对应的 MAC 地址,但是两台设备必须在同一个子网内。

数据在网络中的传输类似于现实生活中的快递运输,中转设备就类似于物流中转中心。快递到达一个中转站之后,中转站会判断下一个中转站的地址然后继续进行派送,直到到达客户所在的中转站。

TCP 协议

TCP 位于传输层,提供可靠的字节流服务。

字节流服务(Byte Stream Service)是指为了传输方便,把大块的数据切割成以报文段(segment)为单位的数据包进行管理。TCP 的可靠之处在于它会确保数据被送到了接收方。

为了确保数据被准确无误地送到了接收方,TCP 采用了三次握手(three-way handshaking)的策略。握手过程中包含了两个重要的标志(flag)——SYN(synchronize)和 ACK(acknowledgement)。

发送端会先发送一个带有 SYN 的数据包给对方,接收端接收到数据之后返回一个 带有 SYN/ACK 标志的数据包给发送端,最后发送端再传回一个带有 ACK 标志的数据包表示“握手”结束。如果握手意外结束,那么 TCP 协议会再次以相同的顺序发送相同的数据包。

tcphandshaking

除了以上三次握手,TCP 还有其他方法确保可靠性。

DNS

DNS 也位于应用层,它提供域名解析服务。能够把域名解析为 IP 地址。

各种协议与 HTTP 之间的关系:

relationship

2.3.4 URI 和 URL

URI(Uniform Resource Identifier,统一资源标识符)RFC2396 对名称中的三个单词做了解释:

  • Uniform, establish uniform format can easily handle different resources, without the resources to identify the access method specified by the context, while adding a new protocol (http, ftp) and easier.
  • Resource, refers to anything that can be identified. It is not limited to documents, pictures or service.
  • Identifier, identifies the object represents, also known identifier.

In addition to HTTP, URI can also be used mailto, ftp, telnet protocol schemes and the like.

URI identifies a particular Internet resources with string and URL string that identifies the resource location. So the URL is a subset of URI.

URI format

urlformat

among them:

  • Login information (authentication) Specifies the user name and password as the login information from the server when access to resources, this is optional.
  • Server address , can be a domain name, IP.
  • Server port number , port number specified server network connection, this alternative, the default port number is omitted.
  • With file path hierarchy , specify a file path to the resource on the server.
  • The query string , parameters can be passed via the query string.
  • Fragment identifier , specify the resources to obtain child (a location within the document) resources.

Guess you like

Origin www.cnblogs.com/DM428/p/11203682.html