A simple understanding of HTTP-TCP/IP and tcpip
1. What is TCP/IP?
If you want to know a person, you can chat from the group where he belongs. Our HTTP protocol is a member of the TCP/IP protocol family. We understand the status of HTTP in the entire network flow and can fully understand HTTP.
To understand what the TCP/IP protocol is, you need to know why it is. Chinese people and Chinese people must follow the Chinese syntax structure and use the Chinese pronunciation. When we talk to foreigners, we need to apply foreign languages and follow foreign grammar institutions and pronunciations. In fact, this is a protocol, but we call it a language. Computers are more intuitive in this aspect. How can we communicate with each other? A variety of protocols need to be developed. For example, the TCP protocol is applicable to file transmission. The DNS Protocol is applicable to the domain name system. With the existence of some protocols, various data streams are transmitted according to rules, and computers are proud to communicate with each other.
TCP/IP protocol is a set of protocols. When you call it, it is called TCP/IP. An important concept in the TCP/IP protocol family is layering. TCP/IP protocols are divided into the following layers. Application Layer, transmission layer, network layer, and data link layer. Why layer? This is like Deng Xiaoping's big contractor in 1978, responsible for people. One layer is only responsible for one level of problems. If a problem occurs, it is irrelevant to other layers, as long as this level is maintained. In fact, programming languages can also reflect this layered theory, that is, encapsulation and isolation. I will not go into detail here. Below is a simplified figure.
Below are the TCP/IP communication data streams found on the Network
2. protocols with close HTTP relationships: IP, TCP, and DNS
IP protocol:IP address (Internet protocol), the IP address here is not worthy of what we usually call 192.168.1.1. This IP address refers to a protocol, and the following number is worthy of being an IP address. The IP protocol is used to accurately transmit various data packets to the other party. The two important conditions are IP addresses and MAC addresses ). Because the IP address is a rare resource, it is impossible for everyone to have an IP address. Therefore, the common IP address is the IP address generated by the router. the MAC address is recorded in the router. The MAC address is the only one in the world and cannot be repeated except for human factors. For example, in real life, the IP address is like the address of our residential area, and the MAC address is the person in the room in the building where we live. For more information about the MAC address, click Connect to view Baidu. The following content is excerpted from graphic HTTP
Use ARP to communicate with MAC addresses
The communication between IP addresses depends on the MAC address. On the network, there are very few communication parties in the same LAN. Generally, they can connect to each other only after multiple computers and network devices. During the transfer, the MAC address of the next transfer device is used to search for the next transfer target. Address Resolution Protocol is used ). ARP is a protocol used to parse an address. Based on the IP address of the Communication Party, the corresponding MAC address can be retrieved.
If you are interested, refer to the Address Resolution Protocol (ARP). For more information, Baidu encyclopedia is much better than Wikipedia.
You can send a message to another computer. How can you find the other computer in the dark:
TCP protocol:If the IP protocol finds the detailed address of the other party. Therefore, the TCP protocol is to bring things securely to the other party. Each has its own division of labor and does not conflict with each other.
By layer, TCP is a transport layer that provides reliable byte stream service. What is byte stream service? This name sounds unknown. Let me explain it in plain words. The so-called byte stream is actually similar to information cutting. For example, if you are a bicycle seller, you have to deliver the goods. The installed bicycle is too large, unstable, and prone to damage. It is better to split the bicycle directly and paste the name of the consignee on each part. After delivery, the bicycles belonging to the same person are assembled. The process of dismantling, transportation, and assembly is actually the process of TCP byte stream.
Let's take a look at the rigorous academic expression:
The Byte Stream Service (Byte Stream Service) refers to the management of data packets in segments to facilitate transmission. Reliable transmission means that data can be transmitted to the other party accurately and reliably. In a word, the TCP protocol separates data for easier transmission of big data, and the TCP protocol can confirm whether the data is finally sent to the other party.
TCP adopts the famous three-way handshaking strategy to ensure that the information is accurate and accurate. Next I will write a dialog to simulate the three handshakes.
DNS:DNS (Domain names System) is a service at the application layer like HTTP protocol, providing resolution services between Domain names and IP addresses.
The Internet communicates with each other through IP addresses, but the IP addresses do not conform to the recognition and memory habits. People like to remember meaningful words. So the DNS service is born to solve this problem. In fact, it is very understandable, like the host file on our computer.
192.168.1.11 roverliang.com
When we access roverliang.com, the computer will not go to the Internet server to query, directly access 192.168.1.111. This is a simple domain name hijacking, which is enough to explain the meaning of DNS.
The following is the role of various protocols in accessing a webpage.
Source: http://www.cnblogs.com/roverliang/p/5176456.html