In: Computer Science
What's the point of having a checksum in the UDP datagram header when the source host doesnt care if some parts of the message do not arrive at the destination?
User Datagram Protocol (UDP) is a Transport Layer protocol. It is unreliable and connectionless protocol. So, there is no need to establish connection prior to data transfer.
UDP header is of 8-bytes in which Checksum is of 2bytes. The main purpose of UDP checksum is to detect errors in transmitted segment. This field is optional in IPv4, and mandatory in IPv6.
UDP uses the checksum in order to determine whether the received data is corrupted along the network or not. The sender will compute the checksum value based on the data and embed it in the frame. At the receiver side checksum is calculated again and matched with sender’s checksum if error is detected then packet is discarded by receiver and not delivered to the socket.
Thus by using checksum you have a reasonable amount of assurance that the data has not been corrupted. Without any checksum, there would be no guarantee that the bytes received are the same as the bytes sent.
Please Rate the answer and if you have any query please ask .