Simple understanding of TCP, UDP, HTTP

We all know that there are very complicated processes inside TCP, UDP, and HTTP. Many people can't understand it so deeply, and just want to know what the hell it is.

1. What are TCP, UDP, and HTTP?

  • TCP/IP is a protocol group that can be divided into three layers: network layer, transport layer and application layer.
  • In the network layer, there are IP protocol, ICMP protocol, ARP protocol, RARP protocol and BOOTP protocol.
  • There are TCP protocol and UDP protocol in the transport layer.
  • In the application layer, there are protocols such as FTP, HTTP, TELNET, SMTP, and DNS.

2. Simple explanation

  • TCP: A connection-oriented protocol
  • UDP: Connectionless oriented protocol
  • HTTP: It is a kind of TCP, built on TCP for transmission

3. TCP has a three-way handshake

Let's take a look at the simple process of these three conversations:

    1. Host A sends a connection request packet to host B: "I want to send you data, can I?", this is the first conversation;
    1. Host B sends to host A a data packet agreeing to connect and requesting synchronization (synchronization means that one of the two hosts is sending and the other is receiving, coordinating work): "Yes, when will you send it?" This is the second conversation;
    1. Host A sends another data packet to confirm host B's request for synchronization: "I'll send it now, you can continue!" This is the third conversation.

Well, at this time, the host has established a connection with the host, and information can be sent through the data transmission rules of the HTTP protocol.
Just like the network is a road, TCP/UDP is a car, HTTP is the people on the car, and each person on the car has a different story (data)

4. What is UDP?

UDP is non-connection-oriented. What does it mean? It’s like sending a text message on a mobile phone. You don’t need to confirm whether the other party can receive it. You can send it directly without establishing a connection. The information sent by QQ is also based on the UDP protocol, so you don't have to worry about not being able to receive the information.

5. The difference between the two protocols

insert image description here

Guess you like

Origin blog.csdn.net/zch981964/article/details/131832462