UDP 与 IP 的区别?区别、UDP、IP

2023-09-08 09:12:45 作者:高傲的存活

I understand that UDP resides on the transport layer and IP on the internet layer. I also get that they're both connectionless and unreliable. Then what is the point of UDP when we already have IP? The distinction is not very clear. Any help on this is greatly appreciated. Thanks!

解决方案

TCP和UDP的区别 tcp ip三四握手和四次挥手 以及TCP,UDP在服务器和客户端的执行步骤

Then what is the point of UDP when we already have IP?

To multiplex services. The UDP port number can differentiate between multiple services on the same host, using the same L3 identification. Using IP only it wouldn't be possible to host multiple services on the same station and easily differentiate between them.

Also, consider the case of UDP over IPv6. Since IPv6 doesn't have error-checking somebody has to perform it: the Checksum field of UDP is not optional.