What is the maximum size of a UDP packet?

Source: Internet
Author: User
What is the maximum size of each UDP packet?
65507 approximately equal to 64K

Why is the maximum 65507?
Because the UDP header has 2 bytes for recording the package body length. 2 bytes can indicate the maximum value is: 2^16-1=64k-1=65535
UDP header accounted for 8 bytes, IP header accounted for 20 bytes, 65535-28 = 65507

What if the UDP message to be sent is greater than 65507?
Need to be sent on the application layer by the developer himself shards. The granularity of the Shard is 65507 bytes maximum. The SendTo function of the system is not supported for single-packet delivery larger than 65507 bytes.


UDP header Format:



The test results are as follows, when the size is 65508 times wrong.

What is the maximum size of a UDP packet?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.