# Q3(b)(ii) · Internet checksum

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/papers/paper-2023-jan-ai-reexam/q3bii

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/papers/paper-2023-jan-ai-reexam--q3bii/

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

### Q3(b)(ii). Compute the Internet checksum of 10110100 01000110 and 11001000 01101110. Write the result as two 8-bit groups separated by one space. [6 marks]

### Answer

### Given

1011010001000110, 1100100001101110; word width = 16 bits.

### To find

Sender checksum and receiver verification.

### Formula and why



$$
S=\operatorname{endAroundCarry}(\text{sum of words}),\qquad C=\operatorname{NOT}(S)
$$



One’s-complement addition returns an overflow carry to the least-significant end. Complement only after all words have been added.

### Solution

### Step 1. Add the words, folding each carry

| Word | Decimal | Raw addition | Folded addition | Running binary sum |
| --- | --- | --- | --- | --- |
| 1011010001000110 | 46150 | 46150 | 46150 + carry 0 = 46150 | 1011010001000110 |
| 1100100001101110 | 51310 | 97460 | 31924 + carry 1 = 31925 | 0111110010110101 |

### Step 2. Complement every bit

Running sum = 0111110010110101. Change every 0 to 1 and every 1 to 0: **checksum = 1000001101001010** (decimal 33610). In the requested two-byte format: **10000011 01001010**.

### Step 3. Receiver adds the data and checksum

31925 + 33610 = 65535 = 1111111111111111. All bits are 1; complement gives all zeros. Therefore this intact message passes the checksum check. A matching checksum detects no error; it does not prove that every possible corruption is absent.
