First of all, let's figure out that the connection between TCP protocol and UCP protocol and TCP/IP protocol, many people are confused, has always said the difference between TCP/IP protocol and UDP protocol, I think this is not in essence to understand network communication!
The TCP/IP protocol is a protocol cluster. It includes a lot of agreements. UDP is just one of them. Named TCP/IP, because TCP, IP is two very important protocols, it is named after him.
The TCP/IP protocol suite includes an application layer, a transport layer, a network layer, and a network access layer.
The application layer includes:
Hypertext Transfer Protocol (HTTP): The basic protocol of the World Wide Web.
File Transfer (TFTP Simple File Transfer Protocol):
Remote login (Telnet), providing remote access to other host functions, which allows users to log in
Internet host and execute commands on this host.
Network Management (SNMP Simple Network Management Protocol), which provides methods for monitoring network devices, as well as configuration management, statistics collection, performance management, and security management.
Domain Name System (DNS), which is used to translate domain names and their public broadcast network nodes into IP addresses on the Internet.
Second, the network layer includes:
Internet Protocol (IP)
Internet Control Information Protocol (ICMP)
Address Resolution Protocol (ARP)
Reverse Address Resolution Protocol (RARP)
Finally, the network access layer: the network access layer is also called host-to-network. The functions of the network access layer include mapping of IP addresses to physical address hardware and encapsulating IP into frames. Based on the network interface of different hardware types, the network access layer defines the connection to the physical medium.
Of course, I am not perfect enough here. The TCP/IP protocol is originally a science. Every branch is a very complicated process, but I believe that every student who studies software development needs to understand it carefully.
Advantages of TCP:
Reliable, stable TCP is reliable in the TCP before the data is transferred, there will be three handshaking to establish a connection, and in the data transfer, there are confirmation, window, retransmission, congestion control mechanism, will be disconnected after the data is transmitted Connections are used to conserve system resources. Disadvantages of TCP: Slow, low efficiency, high system resources, easy to be attacked TCP must first establish a connection before passing data, which will consume time, and in the data transfer, confirmation mechanism, retransmission mechanism, congestion control mechanism, etc. It will consume a lot of time, and all transport connections will be maintained on each device. In fact, each connection will occupy the system's CPU, memory and other hardware resources. Moreover, because TCP has an acknowledgment mechanism and a three-way handshake mechanism, these also cause TCP to be easily utilized, and implement attacks such as DOS, DDOS, and CC.
Advantages of UDP:
Faster, slightly safer than TCP UDP does not have TCP handshake, acknowledgment, window, retransmission, congestion control, etc. UDP is a stateless transport protocol, so it is very fast when passing data. Without these mechanisms of TCP, UDP is less vulnerable to exploits than TCP. However, UDP can not avoid attacks, such as: UDP Flood attack... The disadvantages of UDP: Unreliable, unstable Because UDP does not have reliable mechanisms for TCP, in the case of data transmission, if the network quality is not good, it will be easy to lose packets. . Based on the above advantages and disadvantages, then: When should I use TCP: When there is a requirement for network communication quality, for example, the entire data should be accurately transmitted to the other party, which is often used for some reliable applications, such as HTTP and HTTPS. Protocols for transferring files such as FTP, protocols for mail transmission such as POP and SMTP. In daily life, the common applications using the TCP protocol are as follows: Browser, HTTP FlashFXP, FTP Outlook, POP, SMTP Putty, Telnet, SSH QQ file transfer......... When should I use UDP? : When the quality of network communication is not high, the network communication speed should be as fast as possible, then UDP can be used. For example, in daily life, the common applications using the UDP protocol are as follows: QQ voice QQ video TFTP ......
In some application scenarios, UPD is required for low reliability requirements, such as long video, and the required rate.
Cable Assembly,Tv Adapter Connector,Audio Cable Connector,M12 4Pin Cable Assembly
Shenzhen Hongyian Electronics Co., Ltd. , https://www.hongyiancon.com