UDP vs IP- difference?

后端 未结 2 926
盖世英雄少女心
盖世英雄少女心 2021-02-01 13:36

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 whe

相关标签:
2条回答
  • 2021-02-01 14:16

    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.

    0 讨论(0)
  • 2021-02-01 14:26

    Once a packet reaches a host using its IP address, the packet needs to be given to one of the applications on this machine. To determine which application should get the packet, it needs demultiplexing logic, which is based on ports. UDP has port information which is used by IP to deliver the packet to appropriate application.

    0 讨论(0)
提交回复
热议问题