53.2k views
1 vote
What is the minimum size of a UDP datagram?

User DRastislav
by
8.3k points

1 Answer

4 votes

Final answer:

The minimum size of a UDP datagram is 8 bytes, which is the size of the UDP header. There must be at least one byte of data, making the smallest possible datagram 9 bytes in total. However, the data portion could be empty, making 8 bytes the absolute minimum.

Step-by-step explanation:

The minimum size of a User Datagram Protocol (UDP) datagram is 8 bytes. This is because the header of a UDP datagram is 8 bytes long and consists of four fields: source port (2 bytes), destination port (2 bytes), length (2 bytes), and checksum (2 bytes). There must be at least one byte of data because the length field specifies the total length of the header and the data. Thus, the smallest possible UDP datagram has a header of 8 bytes and a single byte of data, totaling 9 bytes. However, according to the definition of datagram, the data portion could be empty, meaning the size of the UDP header itself (8 bytes) is the absolute minimum.

User ChrisFletcher
by
7.6k points