Binary Inverse Code summation _TCP/IP

Source: Internet
Author: User
Tags bitwise

When you look at TCP/IP, you see that there is a header check in the IP protocol and a binary inverse code sum. Not quite understand, the Internet found an answer, recorded below.


Check and verify with 4bit (easy to compute and 16bit is the same).

Suppose the original data is 1100, 1010, 0000 (check digit)


Then they are added by a bitwise-by-group in 4bit. 1100 Take the counter 0011, 1010 take the reverse is 0101, the check digit is 0011 plus 0101 is 1000, fill in to check digit

So the data sent is


1100, 1010, 1000


After receiving the data, the same bitwise reverse addition is added. 0011+0101+0111 = 1111; All 1 indicates the correct. is equal to oneself plus own reverse, then the result certainly should be all 1. If the transmission is correct.

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.