1. What is TCP/IP
If you want to know a person, you can talk from the group he belongs to. Our HTTP protocol is part of the TCP/IP protocol family, understanding the status of the HTTP protocol throughout the network process, and understanding the HTTP protocol more fully.
To understand what the TCP/IP protocol is, you need to know why this protocol is available. Chinese people speak to Chinese people, follow the grammatical structure of Chinese and use Chinese pronunciation. When we communicate with foreigners, we should apply foreign language, follow the foreign grammatical institutions and pronunciation. This is actually a protocol, but we call it language. The computer is more intuitive in this respect, how to communicate between the two machines, you need to develop a variety of protocols. For example, the file transfer applies to the TCP protocol. DNS protocol for Domain name systems. With the existence of some protocols, various data streams are transmitted in accordance with the rules, and computers are proud of communication.
The TCP/IP protocol is a collection of protocols. We call the time convenient to say, so collectively referred to as TCP/IP. One of the important concepts in the TCP/IP protocol family is layering, which is divided into the following four tiers in the TCP/IP protocol hierarchy. Application layer, Transport layer, network layer, data link layer. Why layering? This is like Deng Xiaoping's 1978 Dabaogan, the responsibility to people. A layer is only responsible for a level of problems, if the problem, and other levels unrelated, as long as the maintenance of this level is good. In fact, the programming language can also embody the hierarchical theory, that is, the sealing, isolation. There is no further detail here. I am a schematic of the production below.
The following is a TCP/IP traffic data stream found on the network
2. HTTP Affinity Protocol: IP, TCP, and DNS
IP protocol: IP (Internet protocol), where the IP is not worth what we usually call 192.168.1.1. This IP refers to a protocol, and the subsequent number is worth the IP address. The purpose of IP protocol is to pass all kinds of packets to each other accurately, of which two important conditions are IP addresses, and MAC addresses (Media Access Control address). Because the IP address is a scarce resource, it is not possible for everyone to have an IP address, so our usual IP address is the IP address that the router gives us, and the router will record our MAC address. The MAC address is the only one in the world and cannot be duplicated except for human factors. To give a real-life example, the IP address is like the address of our residential district, and the MAC address is the one in the building that we live in. About the MAC address, if I am not clear, you can click on the connection to view Baidu. The following excerpt from the illustration of HTTP
Using the ARP protocol to communicate with MAC addresses
Communication between IP is dependent on the MAC address. On the network, the communication between the two sides in the same local area network (LAN) situation is very small, usually through multiple computers and network equipment to connect to each other. While in transit, the next relay device's MAC address is used to search for the next transit target. At this point, the ARP protocol (Address Resolution Protocol) is used. ARP is a protocol used to resolve addresses, and the corresponding MAC address can be detected based on the IP address of the communication party.
Interested can refer to the ARP protocol (Address Resolution Protocol), off-topic, from the document, Baidu Encyclopedia is more than Wikipedia introduced better.
You send a message to another computer, how to find each other in the boundless crowd, the following is the diagram:
TCP protocol: if the IP protocol is to find the other person's detailed address. Then the TCP protocol is to bring the security of things to each other. Each has a division of labor, non-conflict.
by level, TCP belongs to the transport layer and provides a reliable byte stream service. What is the word throttle service? This name does not sound to me, listen to my popular explanation below. The so-called word stream, in fact, is similar to information cutting. For example, you are a bicycle salesman, you have to go to the delivery. The installed bicycles are too large, unstable and prone to damage. Why not just take the bike apart and affix the name of the consignee to each part. Finally sent to the same person in accordance with the bicycle to assemble again, the dismantling, transportation, assembling process is actually the TCP byte stream process.
Let's look at how rigorous academic expression is:
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 in order to make it easier to transfer big data, and the TCP protocol verifies that the data is ultimately delivered to the other party.
To ensure that the information is accurate, TCP uses the well-known three-time handshake strategy (Three-way handshaking). Below I write a dialogue to simulate these three handshakes.
DNS: DNS (domain names System), like the HTTP protocol, is an application-tier service that provides parsing services between domain names and IP addresses.
The internet is communicated by IP address, but the IP address does not meet the memory habits, people like to remember meaningful words. So the DNS service was born to solve this problem. In fact, very well understood, shaped like our computer in the host file.
192.168.1.11 roverliang.com
When we visit the roverliang.com, the computer will not go to the External network server query, directly to access the 192.168.1.111. This is a simple domain hijacking, enough to explain the meaning of DNS.
Here is a page that we visit, the various protocols that play a role in it.
Simple understanding of the HTTP protocol