Network packet error probability and packet error probability

Source: Internet
Author: User

Network packet error probability and packet error probability
Tcp and udp checksum are weak. Simply put, the sum of all values is reversed. Even errors in order cannot be prevented, and there are not many digits, 16 bits. Isn't there a 1/65536 probability that an error will not be detected?
Note that the layer of Ethernet is crc verification, and the two are combined to greatly reduce the probability that errors are not detected.
In case of an error, the application layer can perform another verification. If so, the most feared is that each frame of the protocol may not be long. Once an error occurs, the boundary is completely disordered, in disorder, even very low probability requests are incorrectly interpreted. However, in most cases, data is unavailable.
So bad luck, you can only restart the application or restart the machine.
UDP length, which is limited to sendto:
{
Socklen_t optlen = sizeof (int );
Int optval;
Getsockopt (inet_sock, SOL_SOCKET, SO_SNDBUF, (int *) & optval, & optlen );
Printf ("% d \ n", optval );
}
One machine runs 124928, but this is not the only limit. The other limit is the udp length of 16 bits. In actual tests, the maximum value is 64*1024-29, message Too long if the value is greater than this value.
The udp packet length is small, and the error probability is lower, because the verification is increased. For example, you can set it to an mtu.

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.