Close relationship between IP, TCP, DNS and HTTP

Source: Internet
Author: User

Close relationship between IP, TCP, DNS and HTTP

Knowledge Point

• Concepts and functions of IP protocol

• Concepts and functions of TCP

• TCP three-way handshake

• Concept and role of DNS

• Relationship between HTTP and TCP, IP, and DNS

I. Concepts and functions of IP protocol

Concept of IP:

Internet Protocol, translated as Internet Protocol, is located at the network layer.

The name of this Internet Protocol may sound exaggerated, but that is the case, because almost all systems that use the network use the IP protocol. The IP in the TCP/IP protocol family refers to the Internet protocol, which occupies half of the protocol name. From this, we can know how important the IP protocol is. Here we need to pay attention to two concepts: IP address and IP address. Someone may confuse it. An IP address is actually a protocol name, and an IP address is an IP address.

IP:

Send various data packets to the other party. If you want to ensure that the data is transmitted to the other party, you must satisfy all kinds of conditions. The two most important conditions are IP addresses and MAC addresses.

(1) IP Address: Specifies the address allocated to the node.

(2) MAC address: the fixed address to which the NIC belongs

(3) Difference: IP addresses can be changed, but MAC addresses are basically not changed.

If you want to ensure that data packets are transmitted to the other party, you must meet various conditions. The two most important conditions are IP addresses and MAC addresses.

What is an IP address? The IP address specifies the address allocated to the node. What is a MAC address? The fixed address to which the MAC address belongs. The MAC address is like our ID card number. Each MAC address is unique and remains unchanged. Why can't I change it? Because we can modify the MAC address through software, that is, using software. The IP address can be paired with the MAC address.

Let's take a look at the use of ARP to communicate with MAC addresses.

What is ARP? ARP is a protocol used to parse an address. As long as we know the IP address of the Communication party, we can find the corresponding MAC address. That is to say, the communication between IP addresses depends on the MAC address.

Let's take a look at this figure:

 

On the network, both parties must connect to each other through multiple computers or network devices. During the transfer, the MAC address of the next transfer device will be used to search for the next transfer target. At this time, we will rely on the ARP protocol for processing.

Ii. Concepts and functions of TCP protocol

(1) concept of TCP: TCP is in the transport layer.

(2) What is the role of TCP? It is a reliable byte stream service.

(3) What is the byte stream service? The byte stream service refers to the management of data packets in the packet segment to facilitate transmission.

(4) Why reliability? Because it can accurately and reliably transmit data to the other party. All in all, the TCP protocol separates data to make it easier to transmit big data, and the TCP protocol can determine whether the data is finally delivered to the other party.

(5) How can TCP ensure reliable services? It adopts a three-way handshake policy. That is, after a data packet is sent over TCP, it will not ignore the post-transmission situation and it will definitely want the other Party to confirm whether the packet is delivered successfully.

Iii. Three-way handshake of TCP

Let's take a look at this figure:

 

The TCP flag-SYN and ACK are used during the handshake. The sender first sends a packet with the SYN flag to the other party. After receiving the message, the receiving end returns a packet with the SYN/ACK mark to send the confirmation message. Finally, the sender returns an ACK packet to the receiver, indicating that the handshake is over. In addition to three handshakes to ensure the reliability of the communication, the TCP protocol also has other means to ensure the reliability of the communication. Here I will not be able to explain more, you can read the relevant information to understand.

Iv. concept and role of DNS

(1) concept of DNS: the Domain Name System is translated into a Domain Name System, which is located at the application layer.

(2) What is the role of DNS? It provides resolution services between domain names and IP addresses.

We usually access a website using the host name or domain name instead of the IP address. Why don't we use IP addresses for access? Because the IP address is a group of pure numbers, it is hard to remember. For example, the IP address of geek college is 121.42.104.52, and the domain name is www.itcen.cn. If we use an IP address to access the website, it is hard to remember. Domain names are easy to remember. However, computers and people are different. It is relatively difficult for a computer to understand the name. Computers are better at processing a long string of numbers. To solve this problem, we have the DNS service. The DNS protocol is used to search for IP addresses through domain names, or reverse query of domain names from IP addresses.

V. Relationship between HTTP and TCP, IP, and DNS

Finally, let's take a look at the relationship between HTTP and TCP, IP, and DNS to see what role they play in the communication process.

 

Let me take my blog as an example:

First, I want to access the website and send the domain name to DNS for resolution. After DNS resolution, I return the IP address of the website to the client and then initiate an HTTP request through the IP address. At this time, HTTP is used to generate HTTP request packets for the target WEB server (we refer to the website server here), and then send the request packets to the transport layer. In order to facilitate communication, TCP splits the HTTP request packets into packet segments. These packet segments have an serial number. The packet segments here are sent in order, which one is sent first and which one arrives first. As long as a TCP connection is established, the packet exchange between the client and the server will not be lost, will not be damaged, and there will be no wrong order during receiving. Then, at the network layer, the role of the IP protocol is to search for the address of the other party and transmit the IP address while transferring the IP address. Then, the server is located. In this case, TCP in the transmission layer of the server is responsible for receiving the packet segment sent by the other party and reorganizing it, here, the reorganization is performed by serial number. Then, at the application layer of the server, HTTP processes the client request content. After processing, the server also uses the TCP/IP communication protocol to send a response to the client. After receiving the response, the client displays the content output page. An HTTP transaction is completed.

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.