Read the summary of the illustrated HTTP-Chapter I.

Source: Internet
Author: User
Tags ack app service file transfer protocol server port

First chapter: Understanding Web and Network Foundation

1. Basic Knowledge HTTP: (Hypertext Transfer Protocol, Hypertext Transfer Protocol) client: a Web browser that sends a request for a server resource can be called a client Www:world Wide Web World Wide Web Url:uniform Resource Locator, Uniform Resource Locator uri:uniform Resource Identifier Uniform Resource Identifier Html:hyperte XT Markup Language Hypertext Markup Language
2.Web the process of accessing the browser obtains information such as file resources from the Web server side based on the Url,web browser specified in the Web browser address and displays it on the Web page

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/89/32/wKioL1gMHu3he3MqAADszZ1r4QU397.png-wh_500x0-wm_3 -wmp_4-s_3026861466.png "title=" 01-01.png "alt=" Wkiol1gmhu3he3mqaadszz1r4qu397.png-wh_50 "/>

3. Network-based TCP/IP protocol

3.1 Usually the use of the network (the Internet) is based on the TCP/IP protocol, and HTTP belongs to a subset of its internal. This book describes only the TCP/IP protocol outlines that are required to understand HTTP. 3.2 TCP/IP protocol:     Computers and network devices need to communicate with each other, both sides must be based on the same method. Rules such as how to detect a communication target, which side initiates communication, which language to use for communication, and how to end the communication need to be determined beforehand. Communication between different hardware and operating systems, all of which require a rule. And we call this rule protocol PROTOCOL.    TCP/IP, which is the collective name of the Internet-connected protocol. TCP/IP is a general term used to the Protocol during the communication of the IP protocol. The most important point in 3.3 TCP/IP's layered management     TCP/IP protocol is layering. The TCP/IP protocol is layered on the following 4 tiers: Application layer, Transport layer, network layer, and data link layer. Benefits of      tiering: If the internet is coordinated only by a single protocol, and a place needs to change its design, it must replace all parts of the whole. After layering, you simply replace the changed layer. It is worth mentioning that after the hierarchy, the design has become relatively simple. Applications at the application level can only consider tasks assigned to them, without having to figure out where the other person is on the earth, what the other's transmission lines are, and whether the transmission is guaranteed to be delivered. The functions of each layer of the     TCP/IP protocol are as follows:         application layer:  The application layer determines the activity that communicates when the user provides the app service. All kinds of common application services are stored in the              TCP/IP  agreement. such as FTP (file transferprotocol        File Transfer Protocol), DNS (domain name  system  Domain Name System) The  ,http protocol is also in the application layer.                        Transport Layer: The   transport layer is the upper application layer that provides data transfer between two computers in a network connection.               in the transport layer has two different properties of the Protocol:tcp  ( transmission control protocol ,          Transmission Control Protocol), and UDP (user  data  protocol ,  User Datagram Protocol) .              Network layer:  (aka Network interconnect layer)            The     network layer is used to process packets that flow over the network. A packet is the smallest unit of data transmitted over a network. This layer         provides a way to get to the other computer and send the packet to the other party              Data Link Layer:  (aka link layer, network interface layer)                                is used to handle the hardware part of a network connection. Includes control of operating system, hardware device driver, nic             (network interface card , network adapter, i.e. NIC) and physical visible parts such as fiber optics. The              category on the hardware is within the scope of the link layer. The 3.4 tcp/ip  communication transmission flow          transmission diagram is as follows:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/89/36/wKiom1gMT3KhuVnyAAAdz54t75I921.png-wh_500x0-wm_3 -wmp_4-s_3794158363.png "title=" 01-02.png "alt=" Wkiom1gmt3khuvnyaaadz54t75i921.png-wh_50 "/>

When the TCP/IP protocol is used for network communication, it communicates with each other in a hierarchical order.    The sending side goes down from the application layer, and the receiving end goes to the application layer online. Use HTTP For example: First, send the end 1. The client sends an HTTP request to a Web page that it wants to see at the Application Layer (HTTP protocol), and 2. Then, for transmission convenience, the data received at the Application layer (the HTTP request message) is segmented at the Transport Layer (TCP protocol) and A message labeled serial number and port number is forwarded to the network layer; 3. At the Network layer (IP protocol), increase the MAC address as the destination of the communication and forward to the link layer.    In this way, the communication request for the sending network is ready to complete. Second, the receiving end 4. Servers on the server receive data at the link layer, sequentially to the upper layer, and to the application tier.       When transferred to the application tier, it is true that HTTP requests sent by the client are actually received. Summary: When transmitting data between layers and layers, it is necessary to hit the header information that the layer belongs to before it passes through a layer.    Conversely, the receiving end in the layer and layer to transmit data, does not pass a layer when the corresponding header will be eliminated. The practice of wrapping data information is called encapsulation.

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/89/37/wKiom1gMctOBoC6gAABMFOfwHXA519.png-wh_500x0-wm_3 -wmp_4-s_25578926.png "title=" 01-03.png "alt=" Wkiom1gmctoboc6gaabmfofwhxa519.png-wh_50 "/>


4. Protocols that are closely related to http: IP, TCP, and DNS

4.1 IP protocol 4.1.1 IP protocol for transmission      by level, IP (internet  Protocol) Internet Protocol is located at the network layer. Almost all systems that use the network use the IP protocol. IP in the TCP/IP protocol refers to the Internet Protocol, the name of the agreement occupies half of the position, its importance is reflected. The role of the     IP protocol is to send various packets to each other, and to ensure that they are delivered to each other, you need to meet all kinds of conditions. Two important conditions are IP address and MAC address (media aceess contral address)     4.1.2.  IP address vs. MAC Address: The     IP address indicates the address to which the node is assigned, and the MAC address refers to the fixed address to which the network card belongs. The IP address can be paired with the MAC address. The IP address is variable, but the MAC address basically does not change. The communication between   4.1.3 IP addresses using the ARP protocol with a MAC address is dependent on the MAC address of the communication     ip. On the network, the two sides of the communication are rarely in the same local area network (LAN), usually through multiple computers and network devices to connect to each other. While in transit, the next relay device's MAC address is used to search for the next transit target. The ARP Protocol (ADDRESS RESOLUTION PROTOCOL) is used. ARP is a protocol to resolve the address, according to the IP address of the communication party can be reversed to investigate the corresponding MAC address. 
4.2 To ensure the reliability of the TCP protocol 4.2.1 by level, TCP is located in the transport layer, providing a reliable byte stream service. The so-called byte stream service refers to the segmentation of chunks of data into packet-based packets for ease of transmission, while reliable transmission services refer to the ability to transmit accurate and reliable data to each other. In short, the TCP protocol splits the data to make it easier to transfer big data, and the TCP protocol verifies that the data is ultimately delivered to the other. 4.2.2 ensures that the data reaches the target in order to accurately deliver the data to the target, the TCP protocol employs a three-time handshake strategy. After sending the packet out with the TCP protocol, TCP will not ignore the post-delivery situation, and it will definitely confirm to the other party whether it has been successfully delivered. The TCP flag---SYN (synchronize) and ACK (acknowledgement) used during the handshake

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/89/35/wKioL1gMhmvAfHwLAAA_VRlyOuE098.png-wh_500x0-wm_3 -wmp_4-s_3846835316.png "title=" 01-04.png "alt=" Wkiol1gmhmvafhwlaaa_vrlyoue098.png-wh_50 "/>

The sending side first sends a packet with a SYN flag to the other. When received, a packet with a syn/ack flag is sent back to convey the confirmation message.       The final sender sends back a packet with an ACK flag, representing the end of the handshake. The TCP protocol sends the same packets again in the same order, if a certain period of time is interrupted during the handshake. (in addition to the three handshake, the TCP protocol has other means to ensure the reliability of the communication)
4.3 DNS service for Domain name resolution
The DNS (Domain Name System) service is an application-level protocol that is the same as the HTTP protocol. It provides the parsing service between the domain name and the IP address. DNS is divided into forward parsing (domain name--->ip) and reverse parsing (IP---->dns).


4.4 The relationship between the various protocols and the HTTP protocol ()

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/89/35/wKioL1gMjBCjtKkoAAIRJ7FiqLo255.jpg-wh_500x0-wm_3 -wmp_4-s_1590520987.jpg "title=" 301157290582869607.jpg "alt=" Wkiol1gmjbcjtkkoaairj7fiqlo255.jpg-wh_50 "/>



5.URI and URLs

     compared to URIs (Uniform Resource Identifiers), we are more familiar with URLs (Uniform resource  locator , Uniform Resource Locator).  5.1  Uniform Resource Identifiers   URI    URI : Uniform Resource  identifer   Uniform Resource Identifier        uniform : provision of a unified format to facilitate the processing of a variety of different types of resources, Instead of the context to identify the resource refers to the      access method. In addition, it is easier to add new protocol schemes, such as http: or ftp:.            RESOURCE&NBSP: The definition of a resource is "anything that can be identified". In addition to document files, images, or services (such as weather    forecasts for the day) can be distinguished from other types, all available as resources. Another resource can be a single or a majority of the aggregate.            INDENTIFER : Represents an object that can be identified. Also becomes the identifier.            in summary, a URI is a resource locator identifier represented by a protocol scheme. The protocol scheme is the name of the protocol type used to directly access the resource. When using the HTTP protocol, the Protocol scheme is HTTP. In addition, there are FTP, mailto, telnet, file and so on.    uri identifies an Internet resource with a string, and the URL represents the location of the resource (where the Internet is located). The visible URL is a subset of the URI 
The 5.2 URI format represents the specified URI, using an absolute URI that covers all necessary information, an absolute URL, and a relative URL. Relative URL: Refers to the URL specified from the base URI in the browser, such as the/image/logo.gif absolute URL format:

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/89/35/wKioL1gMmgeydEGUAAAyvAAXh5E506.png-wh_500x0-wm_3 -wmp_4-s_571377936.png "title=" 01-05.png "alt=" Wkiol1gmmgeydeguaaayvaaxh5e506.png-wh_50 "/>

The 5.2.1 Protocol (scheme name) uses http: or https: To specify the protocol type when obtaining access to resources, such as protocol scheme names. (case-insensitive, and the last colon (:)) can also use data: or javascript: The schema name for this type of specified data or script
5.2.2 Login Information (authentication) this option is optional. Specifies the logon information necessary for the user name and password to be used as the server side for resource acquisition. (identity authentication) The 5.2.3 server address using an absolute URI must specify the server address to be accessed. The address can be IP (IPV4, IPV6) or a resolvable domain name 5.2.4 Server port number specifies the network port number of the server connection. This option is also optional.    The default port number is automatically used if the user omits it. 5.2.5 A hierarchical file path specifies the file path on the server to locate the specified resource.    This is similar to the UNIX system's file directory structure.    5.2.6 query string (optional) for resources within the established file path, you can use a query string to pass in any parameter. 5.2.7 fragment identifiers (optional) using fragment identifiers can often mark a child resource in a retrieved resource (a location within the document). However, the use of this method is not explicitly specified in the RFC.

Read the summary of the illustrated HTTP-Chapter I.

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.