Make a summary every day, persistence is victory!
/** @date 2021-06-24 @description "图 文 HTTP" Notes - Chapter 1- Understanding the Web and networking basics */Copy the code
One (sequence)
Web
useHyperText Transfer Protocol (HTTP)
As a specification, complete the client and server side of a series of running operations, so to speakWeb
Is based onHTTP
oncommunication
.- HTTP history
1990 -HTTP/0.9 1996 -HTTP/1.0 1997 -HTTP/1.1 // Supplement 2015 -HTTP/2.0 2018-HTTP/3.0 (still in draft)Copy the code
- TCP/IP
Typically, we use networks that run on top of the TCP/IP family of protocols, of which HTTP is a subset; To communicate between a computer and a network, both sides need to use the same methods. These methods form rules called protocols.Copy the code
- Layer of TCP/IP protocol family
The TCP/IP Protocol family is divided into four layers: a. Application layer: determines the communication activities when providing application services to users, including HTTP, File Transfer Protocol (FTP), and Domain Name System (DNS). B. Transport layer: The transport layer transmits Data between two computers on the network, including Transmission Control Protocol (TCP) and User Data Protocol (UDP). C. Network layer: it deals with packets flowing on the network (packet is the smallest unit of data in network transmission). This layer defines the path (transmission route) used to reach each other's computers and send the packets to each other. Including Internet Protocol (IP). D. Link layer: deals with the hardware part of the networkCopy the code
- When TCP/IP is used to communicate with each other, the sender goes from the application layer to the bottom, and the receiver goes from the bottom to the application layer
6. IP, the protocol that is inseparable from HTTP
IP is different from IP addresses. The former is a protocol located at the network layer. It is responsible for transmission and transmits various data packets to each other. To transmit data correctly, two conditions are required: THE IP Address and the Media Access Control Address (MAC) Address. The IP Address specifies the Address to which a node is assigned, and the MAC Address indicates the fixed location to which a network adapter belongs. Therefore, the IP Address is changeable, while the MAC Address is generally unchanged. Communication between IP addresses depends on MAC addresses. Therefore, you need to use THE Address Resolution Protocol (ARP) to resolve MAC addresses based on IP addressesCopy the code
- TCP, the protocol closely related to HTTP
TCP is located in the transmission layer, which can ensure the reliability of transmission and provide reliable byte stream service. In order to transmit big data more easily, TCP will split the data and then transmit it, and can confirm whether the data is finally transmitted to each other. To send data accurately, TCP uses the three-way handshake policy. The sender sends a packet with the SYN flag to the other end, and the receiver sends a packet with the SYN/ACK flag to confirm the receipt. Finally, the sender sends a packet with the ACK flag to end the handshake. TCP sends the same packets in the same orderCopy the code
- DNS service, a protocol inseparable from HTTP
DNS is used to resolve IP addresses and domain names at the application layerCopy the code
- HTTP communication process
10. The URI and URL
A Uniform Resource Identifier (URI) is a locator of a Resource represented by a protocol scheme. A protocol refers to the type of protocol used to access the Resource, such as HTTP, FTP, Uniform Resource Locator (FILE) is a URL that identifies an Internet Resource with a string when accessing Web resources. A URL identifies the location of a Resource (on the Internet) with a string. Therefore, A URL is a subset of a URICopy the code
Format of URI: