ArticleslgStudy

science

Internet checksum

Internet checksum is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Internet checksum rather than just read about it. In short: The Internet checksum, also called the IPv4 header checksum is a checksum used in version 4 of the Internet Protocol (IPv4) to detect corruption in the header of IPv4 packets. It is carried in the IPv4 packet header, and represents the 16-bit result of the summation of the header words.

Key takeaways

  • Internet checksum belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Internet checksum to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Internet checksum from memory before moving on to harder problems.

Reference excerpt

The Internet checksum, also called the IPv4 header checksum is a checksum used in version 4 of the Internet Protocol (IPv4) to detect corruption in the header of IPv4 packets. It is carried in the IPv4 packet header, and represents the 16-bit result of the summation of the header words. The IPv6 protocol does not use header checksums. Its designers considered that the whole-packet link layer checksumming provided in protocols, such as PPP and Ethernet, combined with the use of checksums in upper-layer protocols such as TCP and UDP, is sufficient. Thus, IPv6 routers are relieved of the task of recomputing the checksum whenever the packet changes, for instance by the lowering of the hop limit counter on every hop. The Internet checksum is mandatory to detect errors in IPv6 UDP packets (including data payload). The Internet checksum is used to detect errors in ICMP packets (including data payload).

Computation The checksum calculation is defined as follows:

The checksum field is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header. For purposes of computing the checksum, the value of the checksum field is zero. If there is no corruption, the result of summing the entire IP header, including checksum, and then taking its one's complement should be zero. At each hop, the checksum is verified. Packets with a checksum mismatch are discarded. The router must adjust the checksum if it changes the IP header (such as when decrementing the TTL). The procedure is explained in detail in RFC 1071 "Computing the Internet Checksum". Optimizations are presented in RFC 1624 "Computation of the Internet Checksum via Incremental Update", to cover the case in routers that need to recompute the header checksum during packet forwarding when only a single field has changed.

Algorithm The internet checksum algorithm by the RFC is:

Examples

Calculating the IPv4 header checksum Take the following truncated excerpt of an IPv4 packet. The header is shown in bold and the checksum is underlined. 4500 0073 0000 4000 4011 b861 c0a8 0001 c0a8 00c7 0035 e97c 005f 279f 1e4b 8180 For ones' complement addition, each time a carry occurs, we must add a 1 to the sum. A carry check and correction can be performed with each addition or as a post-process after all additions. If another carry is generated by the correction, another 1 is added to the sum. To calculate the checksum, we can first calculate the sum of each 16-bit value within the header, skipping only the checksum field itself. Note that these values are in hexadecimal notation. Initial addition: 4500 + 0073 + 0000 + 4000 + 4011 + 0000 + c0a8 + 0001 + c0a8 + 00c7 = 2479c Carry addition is then made by adding the fifth hexadecimal digit to the first 4 digits: 2 + 479c = 479e The checksum is then the ones' complement (bitwise NOT) of this result: NOT 479e = b861 This checksum value is shown as underlined in the original IP packet header above.

Verifying the IPv4 header checksum When verifying a checksum, the same procedure is used as above, except that the original header checksum is not omitted. 4500 + 0073 + 0000 + 4000 + 4011 + b861 + c0a8 + 0001 + c0a8 + 00c7 = 2fffd Add the carry bits: fffd + 2 = ffff Taking the ones' complement (flipping every bit) yields 0000, which indicates that no error is detected. IP header checksum does not check for the correct order of 16-bit values within the header.

See also Frame check sequence Header check sequence

Notes

References

External links Header Checksum

Worked examples

Example 1 — a first encounter with Internet checksum

Start with the simplest possible case. Write down what Internet checksum claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Internet checksum before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Internet checksum ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Internet checksum

In research
Internet checksum appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Internet checksum in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Internet checksum is common in secondary-school and first-year university syllabi. It links to neighbouring topics Error detection and correction, IPv4, so understanding it makes those chapters shorter.
In everyday life
Look for Internet checksum outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Internet checksum” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Internet checksum in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Internet checksum means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Internet checksum out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Internet checksum in simple terms?

The Internet checksum, also called the IPv4 header checksum is a checksum used in version 4 of the Internet Protocol (IPv4) to detect corruption in the header of IPv4 packets. It is carried in the IPv4 packet header, and represents the 16-bit result of the summation of the header words.

Why does Internet checksum matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Internet checksum?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Internet checksum.

Tags

  • Error detection and correction
  • IPv4

Keep exploring