"Graphical http"--tcp/ip first knowledge

Source: Internet
Author: User

First, the TCP/IP protocol family

Computers and network devices need to communicate with each other, and both must be based on the same method. Rules such as how to detect a communication target, where to initiate communication, which language to use for communication, and how to end the communication need to be determined beforehand. All of this requires a rule, which is called a protocol (protocol), also called a handshake.

  

The combination of Internet-related protocols, like this, is always called TCP/IP.

Second, layered management of TCP/IP

For the moment, the OSI model is not discussed, and the TCP/IP protocol families are: application layer, Transport layer, network layer and data link layer respectively. Applications at the application level can only consider tasks assigned to them, rather than figuring out where the other person is on the planet, what the other's transmission route is, and whether the transmission is guaranteed to be delivered.

The functions of each layer of the TCP/IP protocol family are as follows:

Application Layer

The application layer determines the activities that provide the user with communication when it should be served. All kinds of common application services are stored in the TCP/IP protocol family. For example, FTP (file Transfer, Protocol) and DNS (domain Name System) Services are two of these. The HTTP protocol is also in this layer.

Transport Layer

The transport layer provides data transfer between two computers in a network connection to the upper application layer. There are two different protocols in the Transport Layer: TCP (transmission Control Protocol, Transmission Protocol) and UDP (user data Protocol, Subscriber 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 specifies what path (the so-called transmission route) arrives at the opponent's computer and transmits the packet to the other. When transferring from one computer or network device to another, the network layer is used to select a transmission route within a multitude of options.

Link layer (aka Data link layer, network interface layer)

The hardware part that is used to process the connected network. Includes control of operating system, hardware device driver, NIC (Network Interface card, net adapter, i.e. NIC), and physical visible parts such as fiber optics (also including all transmission media such as connectors). The categories on the hardware are within the scope of the link layer.

Third, TCP/IP communication Transport Layer

  

  

When the TCP/IP protocol family is used for network communication, it communicates with each other in a hierarchical order. The sender goes down from the application layer and the receiving end goes to the application layer.

We use HTTP, for example, to first send an HTTP request to a Web page request at the Application layer (HTTP protocol) as the client on the sending side. Then, for the convenience of transmission, the data received from the Application layer (the HTTP request message) is segmented at the Transport Layer (TCP protocol) and forwarded to the network layer by marking the serial number and the port number on each message. On the Network layer (IP protocol), increase the MAC address as the purpose of the communication and then forward to the link layer. In this way, the communication request to the network is ready to complete. The server at the receiving end receives data at the link layer, which is sent sequentially to the upper layer, until the application tier. When transferred to the application tier, it is only true that HTTP requests sent by the client are received.

  

  

When transmitting data between layers and layers, each layer is bound to be hit with the header information that the layer belongs to. Conversely, the receiving end in the layer and layer to transmit data, each pass through a layer of reporting the corresponding header elimination.

This wrapping of data information becomes encapsulated.

Iv. TCP, IP, DNS in TCP/IP

These three protocols are closely related to the HTTP protocol and are discussed below.

1. IP protocol

By hierarchy, the IP (Internet Protocol) Internet Protocol is located at the network layer. The term Internet protocol may sound a bit exaggerated, but it's true because almost all systems using the network use the IP protocol. IP in the TCP/IP protocol family refers to the Internet protocol. Some people may confuse "IP" and "IP Address", "IP" is actually the name of a protocol.

The purpose of the IP protocol is to send various packets to each other. and to ensure that they do transfer to each other, you need to meet all kinds of conditions. The two important conditions are IP address and MAC address (Media Access Control). 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 can be transformed, but the MAC address basically does not change.

Communication between IP is dependent on the MAC address. On the network, the two-way communication in the same local area network (LAN) is very rare, usually through a computer and network equipment in order to connect to each other. While in transit, the next relay device's MAC address is used to search for the next transit target. This is, the ARP protocol (Address Resolution Protocol) will be used. ARP is a protocol to resolve the address, according to the IP address of the communication party can be used to detect the corresponding MAC address.

Network devices, such as computers and routers, can only be informed of a very coarse transmission route during the transit process before reaching the communication target. This mechanism becomes a routing option (routing), a bit like the delivery process of a courier company. Want to send a courier, as long as the delivery of their own goods to the distribution center, you can know whether the courier company is willing to receive a shipment, The courier Company's distribution center check the delivery address of the goods, clear down the gate should be sent to that area of the hub. Then, the distribution center in that area will naturally determine whether it can be sent to each other's home.

The approximate process of transmission:

  

2. TCP protocol

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 packets of packets (segment) to be managed in order to facilitate transmission. The reliable transmission service means that the data can be transmitted to each other accurately and reliably. Word, the TCP protocol splits data to make it easier to transfer big data, and the TCP protocol verifies that the data is ultimately delivered to the other.

To accurately deliver data to the target, the TCP protocol employs a three-time handshake (three-way handshaking) policy. 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) are used during 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.

3. DNS Service

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.

The computer can be assigned either an IP address or a host name and domain name. Like www.baidu.com. Users typically use a host name or domain name to access each other's computer, rather than through an IP address. Because compared with a set of pure numbers of IP addresses, it is more consistent with the human memory habit to specify the computer name in the form of a letter with a numeric representation. But getting the computer to understand the name is relatively difficult. Because computers are better at processing a long list of numbers. In order to solve the above problems, the DNS service came into being. The DNS protocol locates the IP address by providing a domain name, or reverses the service of the domain name from the IP address.

  

V. The relationship between each protocol and the HTTP protocol in the TCP/IP protocol

Learn what the next IP protocol, TCP protocol, and DNS service play in the communication process using the HTTP protocol by entering the URL from the client below to show what happened to the page.

"Graphical http"--tcp/ip first knowledge

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.