The TCP protocol is a unique identifier (IP address, protocol, port) that interacts with other processes using the network communication fee.
TCP and UDP are the most different place, TCP provides a reliable data transmission service, TCP is connection-oriented, that is, the use of TCP communication between the two host first to go through a "call" process, wait until the end of the communication is ready to start transmitting data, and finally end the call. So TCP is more reliable than UDP, UDP is to send the data directly, regardless of whether the other party is not receiving the letter. The so-called process of making a call is:
- Both sides establish the connection
- The sender sends a TCP datagram to the receiver, and then waits for the other party to confirm the TCP datagram, if not, resend it, and if so, send the next datagram.
- The receiving party waits for the sender's datagram, sends an ACK (acknowledgment) datagram, and waits for the next TCP datagram to arrive if the datagram is received and verified to be correct. Until the fin is received (send complete datagram)
- Abort connection
A socket is a communication on the TCP/IP protocol that establishes a socket at each end of the communication to form a network virtual link between the ends of the communication. Once a virtual network link is established, the programs on both ends can communicate through the virtual link.
Socket protocol and HTTP protocol