Http (1) web and network basics and httpweb network Basics

Source: Internet
Author: User

Http (1) web and network basics and httpweb network Basics

An in-depth study of http is nothing more, just to supplement the underlying knowledge, lay a solid foundation, gain a deep understanding of other technologies, capture the thief first, and learn the power of the 9 Yang, Qian Kun moved to another place, the sword is easy, eager for success, it can only be changed to weekly renewal. Walking ......

Source: graphic HTTP

1. access the web through http

The web uses a Protocol called http (HyperText Transfer Protocol) as a standard to complete a series of operational processes from the client to the server.

A protocol is a rule. For example, the conventions or rules that must be observed by two computers or two hardware in a communication network.

It can be said that the web is based on http Communication.

The basic concept originally conceived: the World Wide Web, the World Wide Web, and the World Wide Web)

Now we have proposed the WWW Construction Technology:

①. Use SGML (Standard Generalized Markup Language, Standard universal Markup Language) as the HTML (HyperText MarkupLanguage, HyperText Markup Language) of the text Markup Language of the page ).

②. As the document transfer protocol HTTP.

③. Specify the URL of the document (Uniform Resource Locator, unified Resource Locator ).

2. Basic Network TCP/IP

The commonly used network (including the Internet) operates on the basis of the TCP/IP protocol cluster. HTTP is a subset of HTTP.

  

Ps: a collection of Internet-related protocols will always become TCP/IP

  Layered

TCP/IP is divided into four layers. Just like the system architecture, you can do your own work to facilitate maintenance.

  

() When the TCP/IP protocol is used for network communication, it will communicate with the other party in a hierarchical order. The sender goes down from the application layer, and the receiver goes up to the application layer.

Here is one by one. All the four layers are active.

Application Layer: it makes a choice for the Protocol. It mainly decides the communication activities when providing application services to users. Nothing to mention is that all kinds of common application services are pre-stored in the TCP/IP protocol cluster, for example, select FTP, DNS, and HTTP.

Transmission Layer: the upper application layer is mainly used for data transmission. To be precise, it provides data transmission between two computers in a network connection.

There are two different protocols: TCP (Transmission Control Protocol) and UDP (User Data Protocol User Datagram Protocol)

Network Layer (Network Interconnection layer): select a route to pass data.

Processes the flow of data packets on the network. A data packet is the smallest data unit transmitted over the network. This layer specifies the route used to arrive at the computer of the other party and transmits the data packet to the other party.

Link Layer (data link layer, network interface layer): used to process the hardware part connecting to the network. For example, operating system, hardware driver, NIC, and optical fiber physical courseware. The scope of hardware is within the scope of the link layer.

Ps: to understand it, SF sends a parcel to select a Vehicle Based on the freight rate (Application Layer), Whether to choose to transport parcels by air or by land (Transport Layer), Taking the nearest high speed or aircraft channel (Network Layer) Send the package to the transfer station (Link Layer).

  TCP/IP communication transmission stream

Take HTTP as an example:

The client application layer (http protocol) sends http requests to view Baidu pages =

The transport layer (TCP protocol) splits the received data (http request packets) and marks each packet and port number =

At the network layer (IP protocol), add the MAC address to the destination and forward it to =

Link Layer =

The receiving end server receives data at the link layer, which is sent up in order =

Application Layer (to receive the HTTP request sent by the client)

  

Ps: When the sending end transmits data between the layer and the layer, each passing through a layer is bound to the first information of the layer. On the contrary, when the receiving end transmits data between the layer and the layer, when each layer passes through, the corresponding header information is removed. This method of packaging data is called encapsulation ).

3. Protocols closely related to http: IP, TCP, and DNS

  IP protocol for Transmission

Function: transmits various data packets to the other party. At the network layer.

Prerequisites: to meet various conditions, there are two important requirements: IP Address and MAC (Media Access Control Address)

The communication between IP addresses depends on the MAC address. On the network, the communication parties can connect to each other only after multiple computers and network devices. During the transfer, the MAC address of the next intermediate device is used to search for the next intermediate target, address Resolution Protocal will be used)

Ps: ARP is an IP Address Resolution Protocol. Based on the IP addresses of both parties, the corresponding MAC address can be retrieved.Is an intermediary.

The IP address indicates the address allocated to the node, and the MAC address is 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 will not change.

  

  TCP protocol to ensure reliability

Function: provides reliable Byte Stream Service at the network layer.

What does this mean? The TCP protocol splits the data to make it easier to transmit big data, and the TCP protocol can confirm whether the data is finally sent to the other party.

Ps:It is to build a house to pull cement, a car can not be pulled, a car, a car, and can be sent to the site for use.

For data accuracy, the three-way handshaking policy is adopted.As long as there is feedback, there is usually a mark, otherwise how can we knowThe handshake uses the TCP flag-SYN (synchronize for synchronization) and ACK (acknowledgement for confirmation ).

  

Ps: If a stage is inexplicably interrupted during the intermediate process, TCP sends the same data packet again with the same data. In addition to the TCP protocol, there are other means to ensure the reliability of communication.

DNS responsible for domain name resolution

Purpose: Provide resolution services between domain names and IP addresses, which are located at the application layer.

Cause: computers can be assigned IP addresses or host names and domain names. users usually choose the latter to access the computer. Why, to solve this problem, the DNS service came out.How do you feel like a financial assistant who helps you with financial management? You don't know about finance, and the financial assistant knows how to manage money.

  DNS searches for the IP address through the domain name, or reverse lookup the domain name from the IP address.

  

4. Relationship between various protocols and http protocol

See the following summary:

  

5. URI and URL

URI indicates an Internet resource with a string, and URL indicates the location of the resource. The courseware URL is a subset of the URI.

Indicates the specified URI. Use the absolute URI, absolute URL, and relative URL that cover all necessary information. Relative URL refers to the URL specified from the base URI in the browser.

Absolute URI format

  

Related Article

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.