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.