20.4 UDP Sockets
UDP works on the same level as TCP. However, in contrast to TCP, UDP has fundamentally different characteristics. With UDP, no connection gets established, which means there is no need for a handshake for any connection setup, making UDP much more lightweight than TCP. UDP isn’t suitable for transferring larger amounts of data due to the lack of a connection between the two endpoints of the communication, as the protocol doesn’t have the security mechanisms of TCP, so there’s no guarantee that information won’t get lost.
As with TCP, the size of packages is also limited with UDP, so that, for example, a file to be transferred may have to be divided into several small parts. With TCP, the sequence number ensures that the packages ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access